diff --git a/.gitignore b/.gitignore index a232a040..adea9e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,21 @@ -# Generated by Cargo -# will have compiled files and executables -**/target/ +*.class -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock +# Mobile Tools for Java (J2ME) +.mtj.tmp/ -# These are backup files generated by rustfmt -**/*.rs.bk +*.iml +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* .idea +/target +/logs.home_IS_UNDEFINED + +**/*.iml +.gitattributes -**/log/ diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index 16fe87b0..00000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -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 e143790b..00000000 --- a/LICENSE-MIT +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Wansen Tech - -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/api/pom.xml b/api/pom.xml deleted file mode 100644 index d4a76ec6..00000000 --- a/api/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - 4.0.0 - jar - api - - - 17 - 17 - - - - - mysql - mysql-connector-java - 8.0.26 - - - javax.servlet - javax.servlet-api - 4.0.1 - provided - - - - wansentech - domain - 0.0.1-SNAPSHOT - - - - wansentech - service - 0.0.1-SNAPSHOT - - - - wansentech - utils - 0.0.1-SNAPSHOT - - - - - - - src/main/java - - **/*.xml - - - - src/main/resources - - - - - org.springframework.boot - spring-boot-maven-plugin - - wansenerp - - - org.projectlombok - lombok - - - - - - - - \ No newline at end of file diff --git a/api/src/main/java/com/wansentech/Application.java b/api/src/main/java/com/wansentech/Application.java deleted file mode 100644 index 5daf7c2b..00000000 --- a/api/src/main/java/com/wansentech/Application.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableScheduling; - -@SpringBootApplication -@EnableScheduling -public class Application { - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } -} diff --git a/api/src/main/java/com/wansentech/controller/TestController.java b/api/src/main/java/com/wansentech/controller/TestController.java deleted file mode 100644 index f9bad7e2..00000000 --- a/api/src/main/java/com/wansentech/controller/TestController.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.controller; - -public class TestController { -} diff --git a/api/src/main/java/com/wansentech/controller/UserController.java b/api/src/main/java/com/wansentech/controller/UserController.java deleted file mode 100644 index 96c5aac0..00000000 --- a/api/src/main/java/com/wansentech/controller/UserController.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.controller; - -import com.wansentech.Response; -import com.wansentech.api.dto.UserRegisterDto; -import com.wansentech.enums.CodeEnum; -import com.wansentech.service.bo.UserRegisterBo; -import com.wansentech.user.UserService; -import jakarta.annotation.Resource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/user") -public class UserController { - - private final UserService userService; - - public UserController(UserService userService) { - this.userService = userService; - } - - @PostMapping("/register") - public Response UserRegister(@RequestBody UserRegisterDto userRegisterDto){ - var userRegisterBo = UserRegisterBo.builder() - .name(userRegisterDto.getUserName()) - .userName(userRegisterDto.getUserName()) - .password(userRegisterDto.getPassword()) - .email(userRegisterDto.getEmail()) - .phoneNumber(userRegisterDto.getPhoneNumber()).build(); - - return userService.addUser(userRegisterBo); - } -} diff --git a/api/src/main/resources/application-dev.yml b/api/src/main/resources/application-dev.yml deleted file mode 100644 index 888a1fda..00000000 --- a/api/src/main/resources/application-dev.yml +++ /dev/null @@ -1,11 +0,0 @@ -spring: - datasource: - url: jdbc:mysql://localhost:3306/wansenerp?useUnicode=true&characterEncoding=utf-8&useSSL=false - username: root - password: PaSsw0Rd - dynamic: - druid: - max-wait: 60000 - initial-size: 5 - min-idle: 5 - max-active: 20 \ No newline at end of file diff --git a/api/src/main/resources/application-prod.yml b/api/src/main/resources/application-prod.yml deleted file mode 100644 index afe2c85f..00000000 --- a/api/src/main/resources/application-prod.yml +++ /dev/null @@ -1,13 +0,0 @@ -spring: - datasource: - druid: - username: 123456 - password: 123456 - url: jdbc:mysql://1.2.3.4:3306/123456?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true - driver-class-name: com.mysql.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - initial-size: 5 - min-idle: 5 - max-active: 20 - # 配置获取连接等待超时的时间 - max-wait: 60000 \ No newline at end of file diff --git a/api/src/main/resources/application.yml b/api/src/main/resources/application.yml deleted file mode 100644 index 237409ca..00000000 --- a/api/src/main/resources/application.yml +++ /dev/null @@ -1,36 +0,0 @@ -server: - port: 8090 - servlet: - context-path: / - -spring: - profiles: - active: dev - - mvc: - pathmatch: - matching-strategy: ant_path_matcher - - servlet: - multipart: - max-file-size: 1024MB - max-request-size: 100MB - - jackson: - date-format: yyyy-MM-dd HH:mm:ss - time-zone: GMT+8 - default-property-inclusion: always - property-naming-strategy: SNAKE_CASE - -logging: - config: classpath:logback-spring.xml - -mybatis-plus: - mapper-locations: classpath:./mapper_xml/*Mapper.xml - type-aliases-package: com.wansentech.dao.entity - global-config: - id-type: 0 - #驼峰下划线转换 - db-column-underline: true - #刷新mapper 调试神器 - refresh-mapper: true \ No newline at end of file diff --git a/api/src/main/resources/logback-spring.xml b/api/src/main/resources/logback-spring.xml deleted file mode 100644 index a086757f..00000000 --- a/api/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - logback - - - - - - - - - - - - - - - - - debug - - - ${CONSOLE_LOG_PATTERN} - - UTF-8 - - - - - - - - - - ${log.path}/log_debug.log - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - UTF-8 - - - - - ${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log - - 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/test/java/com/wansentech/UserSampleTest.java b/api/src/test/java/com/wansentech/UserSampleTest.java deleted file mode 100644 index 94b4b925..00000000 --- a/api/src/test/java/com/wansentech/UserSampleTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.wansentech;/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest(classes = Application.class) -public class UserSampleTest { - - @Test - public void testSelect() { - System.out.println(("----- selectAll method test ------")); - } -} diff --git a/dao/pom.xml b/dao/pom.xml deleted file mode 100644 index b24a3693..00000000 --- a/dao/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - 4.0.0 - dao - - - 17 - 17 - - - - - wansentech - domain - 0.0.1-SNAPSHOT - - - wansentech - utils - 0.0.1-SNAPSHOT - - - \ No newline at end of file diff --git a/dao/src/main/java/com/wansentech/aggregateservice/UserAggregate.java b/dao/src/main/java/com/wansentech/aggregateservice/UserAggregate.java deleted file mode 100644 index 592901e9..00000000 --- a/dao/src/main/java/com/wansentech/aggregateservice/UserAggregate.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.aggregateservice; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.wansentech.Response; -import com.wansentech.dao.entity.User; -import com.wansentech.dao.po.UserRegisterPo; - -public interface UserAggregate extends IService { - - boolean insertUser(UserRegisterPo userRegisterPo); - - boolean existUser(String userName); -} diff --git a/dao/src/main/java/com/wansentech/aggregateservice/impl/UserAggregateImpl.java b/dao/src/main/java/com/wansentech/aggregateservice/impl/UserAggregateImpl.java deleted file mode 100644 index 6bbe0a67..00000000 --- a/dao/src/main/java/com/wansentech/aggregateservice/impl/UserAggregateImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.aggregateservice.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansentech.aggregateservice.UserAggregate; -import com.wansentech.dao.entity.User; -import com.wansentech.dao.po.UserRegisterPo; -import com.wansentech.mappers.UserMapper; -import org.springframework.stereotype.Service; - -@Service -public class UserAggregateImpl extends ServiceImpl implements UserAggregate{ - - private UserMapper userMapper; - - public UserAggregateImpl(UserMapper userMapper) { - this.userMapper = userMapper; - } - - @Override - public boolean insertUser(UserRegisterPo userRegisterPo) { - - User user = new User(); - user.setId(userRegisterPo.getId()); - user.setName(userRegisterPo.getName()); - user.setUserName(userRegisterPo.getUserName()); - user.setPassword(userRegisterPo.getPassword()); - user.setEmail(userRegisterPo.getEmail()); - user.setPhoneNumber(userRegisterPo.getPhoneNumber()); - user.setStatus(0); - user.setRemark(userRegisterPo.getRemark()); - user.setTenantId(0L); - - return save(user); - } - - @Override - public boolean existUser(String userName) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(User::getUserName, userName); - - return userMapper.exists(queryWrapper); - } -} diff --git a/dao/src/main/java/com/wansentech/mappers/UserMapper.java b/dao/src/main/java/com/wansentech/mappers/UserMapper.java deleted file mode 100644 index a0ba5676..00000000 --- a/dao/src/main/java/com/wansentech/mappers/UserMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.mappers; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import com.wansentech.dao.entity.User; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface UserMapper extends BaseMapper { -} diff --git a/dao/src/main/resources/mapper_xml/UserMapper.xml b/dao/src/main/resources/mapper_xml/UserMapper.xml deleted file mode 100644 index 23cf720f..00000000 --- a/dao/src/main/resources/mapper_xml/UserMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index ad5e5dfa..00000000 --- a/domain/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - 4.0.0 - domain - - - 17 - 17 - - - \ No newline at end of file diff --git a/domain/src/main/java/com/wansentech/api/dto/UserRegisterDto.java b/domain/src/main/java/com/wansentech/api/dto/UserRegisterDto.java deleted file mode 100644 index 1ae4f05b..00000000 --- a/domain/src/main/java/com/wansentech/api/dto/UserRegisterDto.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.api.dto; - -import lombok.Data; - -@Data -public class UserRegisterDto { - - private String userName; - - private String password; - - private String email; - - private String phoneNumber; -} diff --git a/domain/src/main/java/com/wansentech/api/package-info.java b/domain/src/main/java/com/wansentech/api/package-info.java deleted file mode 100644 index 2ffed911..00000000 --- a/domain/src/main/java/com/wansentech/api/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ - -/** - * package wansentech.entity; - * - * This package store data object, Note: Naming specification (Dto, Vo) - * - * dto: Data Transfer Object - * vo: View Object - * - */ -package com.wansentech.api; \ No newline at end of file diff --git a/domain/src/main/java/com/wansentech/dao/entity/User.java b/domain/src/main/java/com/wansentech/dao/entity/User.java deleted file mode 100644 index b6e43c43..00000000 --- a/domain/src/main/java/com/wansentech/dao/entity/User.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.dao.entity; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @author jameszow - */ -@Data -public class User implements Serializable { - - private static final long serialVersionUID = -7992197375083373335L; - - private Long id; - - private String name; - - private String userName; - - private String password; - - private String email; - - private String phoneNumber; - - private int status; - - private String remark; - - private Long tenantId; - -} diff --git a/domain/src/main/java/com/wansentech/dao/package-info.java b/domain/src/main/java/com/wansentech/dao/package-info.java deleted file mode 100644 index 03582f18..00000000 --- a/domain/src/main/java/com/wansentech/dao/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ - -/** - * package wansentech.entity; - * - * This package store data object, Note: Naming specification (datatable field name, Po) - * - * entity: Directly corresponding to database native fields And database field 1 to 1 - * po: Persistence layer object, do not operate the database directly - * - */ -package com.wansentech.dao; \ No newline at end of file diff --git a/domain/src/main/java/com/wansentech/dao/po/UserRegisterPo.java b/domain/src/main/java/com/wansentech/dao/po/UserRegisterPo.java deleted file mode 100644 index 87c6cd97..00000000 --- a/domain/src/main/java/com/wansentech/dao/po/UserRegisterPo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.dao.po; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class UserRegisterPo { - - private Long id; - - private String name; - - private String userName; - - private String password; - - private String email; - - private String phoneNumber; - - private int status; - - private String remark; - - private Long tenantId; -} diff --git a/domain/src/main/java/com/wansentech/service/bo/UserRegisterBo.java b/domain/src/main/java/com/wansentech/service/bo/UserRegisterBo.java deleted file mode 100644 index d5c4139d..00000000 --- a/domain/src/main/java/com/wansentech/service/bo/UserRegisterBo.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.service.bo; - -import lombok.Builder; -import lombok.Data; - -@Data -@Builder -public class UserRegisterBo { - - private Long id; - - private String name; - - private String userName; - - private String password; - - private String email; - - private String phoneNumber; - - private int status; - - private String remark; - - private Long tenantId; -} diff --git a/domain/src/main/java/com/wansentech/service/package-info.java b/domain/src/main/java/com/wansentech/service/package-info.java deleted file mode 100644 index 63037dfc..00000000 --- a/domain/src/main/java/com/wansentech/service/package-info.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ - -/** - * package wansentech.entity; - * - * This package store data object, Note: Naming specification (Bo, do) - * - * bo: Business Object, Assembly of multiple persistence layer objects. - * do: Domain Object, The corresponding entity of the receiving database has some mapping relationship with the database - * - * Note: Currently, the domain object has not been used, which does not mean that it will not be used later - */ -package com.wansentech.service; \ No newline at end of file diff --git a/mvnw b/mvnw deleted file mode 100755 index 8a8fb228..00000000 --- a/mvnw +++ /dev/null @@ -1,316 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 -# -# https://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. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`\\unset -f command; \\command -v java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100644 index 1d8ab018..00000000 --- a/mvnw.cmd +++ /dev/null @@ -1,188 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause - -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% - -cmd /C exit /B %ERROR_CODE% diff --git a/plugs/pom.xml b/plugs/pom.xml deleted file mode 100644 index e2f86109..00000000 --- a/plugs/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - 4.0.0 - jar - plugs - - - 17 - 17 - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0de8ac86..7ff1dff3 100644 --- a/pom.xml +++ b/pom.xml @@ -1,58 +1,158 @@ + 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 + WanSenERP + 1.0-SNAPSHOT + jar + + WanSenERP + 万森ERP + org.springframework.boot spring-boot-starter-parent - 3.0.3 - + 3.1.3 - wansentech - wansnenerp - pom - 0.0.1-SNAPSHOT - wansnenerp - WanSen erp system + - 17 - true + UTF-8 + UTF-8 + 17 + 17 - - domain - utils - plugs - service - dao - api - + org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test test - - - org.slf4j - slf4j-simple - 1.7.32 - compile - - - - org.projectlombok - lombok - 1.18.24 - provided - - + + org.springframework.boot + spring-boot-starter-data-redis + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + com.alibaba + fastjson + 1.2.83 + + + mysql + mysql-connector-java + 8.0.32 + + + + org.apache.httpcomponents + httpclient + 4.5.14 + + + net.sourceforge.jexcelapi + jxl + 2.6.12 + + + + org.projectlombok + lombok + 1.18.24 + provided + + + + javax.mail + javax.mail-api + 1.5.6 + + + + org.apache.logging.log4j + log4j-to-slf4j + 2.15.0 + compile + + + org.slf4j + jul-to-slf4j + 1.7.25 + compile + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3.1 + + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.4.1 + + + io.springfox + springfox-boot-starter + 3.0.0 + + + + + + + + com.aliyun.oss + aliyun-sdk-oss + 3.16.3 + - + + WanSenERP + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + generate-sources + + build-info + + + + repackage + package + + repackage + + + com.wansensoft.erp.ErpApplication + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.4.0 + + ${basedir}/src/test/resources/generatorConfig.xml + true + true + + + + diff --git a/service/pom.xml b/service/pom.xml deleted file mode 100644 index 9ccb2f31..00000000 --- a/service/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - 4.0.0 - jar - service - - - 17 - 17 - - - - - wansentech - domain - 0.0.1-SNAPSHOT - - - - wansentech - dao - 0.0.1-SNAPSHOT - - - \ No newline at end of file diff --git a/service/src/main/java/com/wansentech/user/UserService.java b/service/src/main/java/com/wansentech/user/UserService.java deleted file mode 100644 index caef1137..00000000 --- a/service/src/main/java/com/wansentech/user/UserService.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.user; - -import com.wansentech.Response; -import com.wansentech.service.bo.UserRegisterBo; - -public interface UserService { - - Response addUser(UserRegisterBo userRegisterBo); -} diff --git a/service/src/main/java/com/wansentech/user/impl/UserServiceImpl.java b/service/src/main/java/com/wansentech/user/impl/UserServiceImpl.java deleted file mode 100644 index 8c58c49b..00000000 --- a/service/src/main/java/com/wansentech/user/impl/UserServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.user.impl; - -import com.wansentech.Response; -import com.wansentech.SnowflakeIdUtil; -import com.wansentech.aggregateservice.UserAggregate; -import com.wansentech.dao.po.UserRegisterPo; -import com.wansentech.enums.CodeEnum; -import com.wansentech.mappers.UserMapper; -import com.wansentech.service.bo.UserRegisterBo; -import com.wansentech.user.UserService; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * user interface (Service layer) - */ -@Service -@Slf4j -public class UserServiceImpl implements UserService { - - private final UserMapper userMapper; - private final UserAggregate userAggregate; - - public UserServiceImpl(UserMapper userMapper, UserAggregate userAggregate) { - this.userMapper = userMapper; - this.userAggregate = userAggregate; - } - - @Override - public Response addUser(UserRegisterBo userRegisterBo) { - // check exist user - boolean existUserName = userAggregate.existUser(userRegisterBo.getUserName()); - if (existUserName) { - return Response.responseMsg(CodeEnum.USER_EXISTS); - } - - UserRegisterPo userRegisterPo = UserRegisterPo.builder() - .id(SnowflakeIdUtil.nextId()) - .name(userRegisterBo.getName()) - .userName(userRegisterBo.getUserName()) - .password(userRegisterBo.getPassword()) - .email(userRegisterBo.getEmail()) - .phoneNumber(userRegisterBo.getPhoneNumber()). - status(0). - remark(userRegisterBo.getRemark()). - tenantId(userRegisterBo.getTenantId()).build(); - - boolean result = userAggregate.insertUser(userRegisterPo); - if (result) { - return Response.responseMsg(CodeEnum.REGISTER_SUCCESS); - } - - return Response.fail(); - } -} diff --git a/src/main/assembly/assembly.xml b/src/main/assembly/assembly.xml new file mode 100644 index 00000000..1478080c --- /dev/null +++ b/src/main/assembly/assembly.xml @@ -0,0 +1,67 @@ + + + + bin + + + zip + + + true + + + + ${project.basedir}/target + + *.jar + + /lib + + + ${project.basedir}/src/main/resources + + *.properties + *.yml + *.yaml + *.xml + + /config + + + ${project.basedir}/src/main/bin + /bin + + run-manage.sh + + unix + + + ${project.basedir}/src/main/bin/ + / + + start.bat + restart.sh + start.sh + stop.sh + status.sh + + + + docs + /docs + + + ${project.basedir} + + *.md + *.txt + + / + + + \ No newline at end of file diff --git a/src/main/bin/restart.sh b/src/main/bin/restart.sh new file mode 100644 index 00000000..70c0be15 --- /dev/null +++ b/src/main/bin/restart.sh @@ -0,0 +1 @@ +./bin/run-manage.sh restart \ No newline at end of file diff --git a/src/main/bin/run-manage.sh b/src/main/bin/run-manage.sh new file mode 100644 index 00000000..45d493de --- /dev/null +++ b/src/main/bin/run-manage.sh @@ -0,0 +1,131 @@ +SERVER_NAME=jshERP +readonly APP_HOME=${FILE_PATH:-$(dirname $(cd `dirname $0`; pwd))} +#readonly JAVA_HOME="" +readonly CONFIG_HOME="$APP_HOME/config/" +readonly LIB_HOME="$APP_HOME/lib" +readonly LOGS_HOME="$APP_HOME/logs" +readonly PID_FILE="$LOGS_HOME/application.pid" +readonly APP_MAIN_CLASS="jshERP.jar" +readonly LOG_CONFIG="$CONFIG_HOME/logback-spring.xml" +readonly JAVA_RUN="-Dlogs.home=$LOGS_HOME -Dlogging.config=$LOG_CONFIG -Dspring.config.location=file:$CONFIG_HOME -Dspring.pid.file=$PID_FILE -Dspring.pid.fail-on-write-error=true" +readonly JAVA_OPTS="-server -Xms128m -Xmx320m -XX:PermSize=128M -XX:MaxPermSize=256M $JAVA_RUN" +readonly JAVA="java" +PID=0 +if [ ! -x "$LOGS_HOME" ] +then + mkdir $LOGS_HOME +fi +chmod +x -R "$JAVA_HOME/bin/" +functions="/etc/functions.sh" +if test -f $functions ; then + . $functions +else + success() + { + echo " SUCCESS! $@" + } + failure() + { + echo " ERROR! $@" + } + warning() + { + echo "WARNING! $@" + } +fi +function checkpid() { + PID=$(ps -ef | grep $APP_MAIN_CLASS | grep -v 'grep' | awk '{print int($2)}') + if [[ -n "$PID" ]] + then + return 0 + else + return 1 + fi +} +function start() { + checkpid + if [[ $? -eq 0 ]] + then + warning "[$APP_MAIN_CLASS]: already started! (PID=$PID)" + else + echo -n "[$APP_MAIN_CLASS]: Starting ..." + JAVA_CMD="nohup $JAVA $JAVA_OPTS -jar $LIB_HOME/$APP_MAIN_CLASS > /dev/null 2>&1 &" + # echo "Exec cmmand : $JAVA_CMD" + sh -c "$JAVA_CMD" + sleep 3 + checkpid + if [[ $? -eq 0 ]] + then + success "(PID=$PID) " + else + failure " " + fi + fi +} +function stop() { + checkpid + if [[ $? -eq 0 ]]; + then + echo -n "[$APP_MAIN_CLASS]: Shutting down ...(PID=$PID) " + kill -9 $PID + if [[ $? -eq 0 ]]; + then + echo 0 > $PID_FILE + success " " + else + failure " " + fi + else + warning "[$APP_MAIN_CLASS]: is not running ..." + fi +} +function status() { + checkpid + if [[ $? -eq 0 ]] + then + success "[$APP_MAIN_CLASS]: is running! (PID=$PID)" + return 0 + else + failure "[$APP_MAIN_CLASS]: is not running" + return 1 + fi +} +function info() { + echo "System Information:" + echo + echo "****************************" + echo `head -n 1 /etc/issue` + echo `uname -a` + echo + echo "JAVA_HOME=$JAVA_HOME" + echo + echo "JAVA Environment Information:" + echo `$JAVA -version` + echo + echo "APP_HOME=$APP_HOME" + echo "APP_MAIN_CLASS=$APP_MAIN_CLASS" + echo + echo "****************************" +} +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + stop + start + ;; + 'status') + status + ;; + 'info') + info + ;; + *) + echo "Usage: $0 {help|start|stop|restart|status|info}" + ;; +esac +exit 0 \ No newline at end of file diff --git a/src/main/bin/start.bat b/src/main/bin/start.bat new file mode 100644 index 00000000..37b8bb51 --- /dev/null +++ b/src/main/bin/start.bat @@ -0,0 +1,6 @@ +@echo off + +title jshERP + +java -Xms1000m -Xmx2000m -jar .\lib\jshERP.jar +pause over \ No newline at end of file diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh new file mode 100644 index 00000000..d0bf0677 --- /dev/null +++ b/src/main/bin/start.sh @@ -0,0 +1 @@ +./bin/run-manage.sh start \ No newline at end of file diff --git a/src/main/bin/status.sh b/src/main/bin/status.sh new file mode 100644 index 00000000..46d65372 --- /dev/null +++ b/src/main/bin/status.sh @@ -0,0 +1 @@ +./bin/run-manage.sh status \ No newline at end of file diff --git a/src/main/bin/stop.sh b/src/main/bin/stop.sh new file mode 100644 index 00000000..8f3414e7 --- /dev/null +++ b/src/main/bin/stop.sh @@ -0,0 +1 @@ +./bin/run-manage.sh stop \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/ErpApplication.java b/src/main/java/com/wansensoft/erp/ErpApplication.java new file mode 100644 index 00000000..451df396 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/ErpApplication.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp; + +import com.wansensoft.erp.utils.ComputerInfo; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.Environment; +import org.springframework.scheduling.annotation.EnableScheduling; + +import java.io.IOException; + +@SpringBootApplication +@MapperScan(basePackages = {"com.wansensoft.erp.datasource.mappers"}) +@ServletComponentScan +@EnableScheduling +public class ErpApplication{ + public static void main(String[] args) throws IOException { + ConfigurableApplicationContext context = SpringApplication.run(ErpApplication.class, args); + Environment environment = context.getBean(Environment.class); + System.out.println("启动成功,后端服务API地址:http://" + ComputerInfo.getIpAddr() + ":" + + environment.getProperty("server.port") + "/wansenerp/doc.html"); + System.out.println("您还需启动前端服务,启动命令:yarn run serve 或 npm run serve,测试用户:jsh,密码:123456"); + } +} diff --git a/src/main/java/com/wansensoft/erp/config/Swagger2Config.java b/src/main/java/com/wansensoft/erp/config/Swagger2Config.java new file mode 100644 index 00000000..efeadcc9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/config/Swagger2Config.java @@ -0,0 +1,44 @@ +package com.wansensoft.erp.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("华夏ERP Restful Api") + .description("华夏ERP接口描述") + .termsOfServiceUrl("http://127.0.0.1") + .contact(new Contact("jishenghua", "", "")) + .version("3.0") + .build(); + } + +} diff --git a/src/main/java/com/wansensoft/erp/config/TenantConfig.java b/src/main/java/com/wansensoft/erp/config/TenantConfig.java new file mode 100644 index 00000000..a763b9f1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/config/TenantConfig.java @@ -0,0 +1,112 @@ +package com.wansensoft.erp.config; + +import com.baomidou.mybatisplus.core.parser.ISqlParser; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; +import com.baomidou.mybatisplus.core.plugins.*; +import com.wansensoft.erp.utils.Tools; +import jakarta.servlet.http.HttpServletRequest; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.LongValue; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.reflection.MetaObject; +import org.mybatis.spring.mapper.MapperScannerConfigurer; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + +@Service +public class TenantConfig { + +// @Bean +// public PaginationInnerInterceptor paginationInterceptor(HttpServletRequest request) { +// 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.erp.datasource.mappers*"); + return scannerConfigurer; + } + + /** + * 性能分析拦截器,不建议生产使用 + */ +// @Bean +// public PerformanceInterceptor performanceInterceptor(){ +// return new PerformanceInterceptor(); +// } + + +} diff --git a/src/main/java/com/wansensoft/erp/constants/BusinessConstants.java b/src/main/java/com/wansensoft/erp/constants/BusinessConstants.java new file mode 100644 index 00000000..f218bfb3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/constants/BusinessConstants.java @@ -0,0 +1,213 @@ +package com.wansensoft.erp.constants; + +/** + * @ClassName:BusinessConstants + * @Description 业务字典类 + * @Author qiankunpingtai + * @Date 2019-3-6 17:58 + * @Version 1.0 + **/ +public class BusinessConstants { + + /** + * 默认的日期格式 + */ + public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + /** + * 一天的初始时间 + */ + public static final String DAY_FIRST_TIME = " 00:00:00"; + /** + * 一天的结束时间 + */ + public static final String DAY_LAST_TIME = " 23:59:59"; + /** + * 默认的分页起始页页码 + */ + public static final Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1; + /** + * 无数据时列表返回的默认数据条数 + */ + public static final Long DEFAULT_LIST_NULL_NUMBER = 0L; + /** + * 默认的分页条数 + */ + public static final Integer DEFAULT_PAGINATION_PAGE_SIZE = 10; + /** + * 单据主表出入库类型 type 入库 出库 其它 + * depothead + * */ + public static final String DEPOTHEAD_TYPE_IN = "入库"; + public static final String DEPOTHEAD_TYPE_OUT = "出库"; + public static final String DEPOTHEAD_TYPE_OTHER = "其它"; + /** + * 付款类型 payType //现付/预付款 + * */ + public static final String PAY_TYPE_PREPAID = "预付款"; + public static final String PAY_TYPE_BY_CASH = "现付"; + /** + * 删除标记 deleteFlag '0'未删除 '1'已删除 + * */ + public static final String DELETE_FLAG_DELETED = "1"; + public static final String DELETE_FLAG_EXISTS = "0"; + /** + * 是否卖出 isSell '0'未卖出 '1'已卖出 + * */ + public static final String IS_SELL_SELLED = "1"; + public static final String IS_SELL_HOLD = "0"; + /** + * 商品是否开启序列号标识enableSerialNumber '0'未启用 '1'启用 + * */ + public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1"; + public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0"; + /** + * 商品是否开启批号标识enableBatchNumber '0'未启用 '1'启用 + * */ + public static final String ENABLE_BATCH_NUMBER_ENABLED = "1"; + public static final String ENABLE_BATCH_NUMBER_NOT_ENABLED = "0"; + /** + * 单据状态 billsStatus '0'未审核 '1'审核 '2'完成采购|销售 '3'部分采购|销售 + * */ + public static final String BILLS_STATUS_UN_AUDIT = "0"; + public static final String BILLS_STATUS_AUDIT = "1"; + public static final String BILLS_STATUS_SKIPED = "2"; + public static final String BILLS_STATUS_SKIPING = "3"; + /** + * 单据-采购状态 purchaseStatus '0'未采购、'2'完成采购、'3'部分采购 + * */ + public static final String PURCHASE_STATUS_UN_AUDIT = "0"; + public static final String PURCHASE_STATUS_SKIPED = "2"; + public static final String PURCHASE_STATUS_SKIPING = "3"; + /** + * 出入库分类 + *采购、采购退货、其它、零售、销售、调拨、盘点复盘等 + * */ + public static final String SUB_TYPE_PURCHASE_ORDER = "采购订单"; + public static final String SUB_TYPE_PURCHASE = "采购"; + public static final String SUB_TYPE_PURCHASE_RETURN = "采购退货"; + public static final String SUB_TYPE_OTHER = "其它"; + public static final String SUB_TYPE_RETAIL = "零售"; + public static final String SUB_TYPE_RETAIL_RETURN = "零售退货"; + public static final String SUB_TYPE_SALES_ORDER = "销售订单"; + public static final String SUB_TYPE_SALES = "销售"; + public static final String SUB_TYPE_SALES_RETURN = "销售退货"; + public static final String SUB_TYPE_TRANSFER = "调拨"; + public static final String SUB_TYPE_CHECK_ENTER = "盘点录入"; + public static final String SUB_TYPE_REPLAY = "盘点复盘"; + public static final String SUB_TYPE_ASSEMBLE = "组装单"; + public static final String SUB_TYPE_DISASSEMBLE = "拆卸单"; + /** + * 财务单据分类 + * 收款、付款 + * */ + public static final String TYPE_MONEY_IN = "收款"; + public static final String TYPE_MONEY_OUT = "付款"; + /** + * 批量插入sql时最大的数据条数 + * */ + public static final int BATCH_INSERT_MAX_NUMBER = 500; + /** + * sequence名称 + * */ + //sequence返回字符串的最小长度 + public static final Long SEQ_TO_STRING_MIN_LENGTH = 10000000000L; + //sequence长度小于基准长度时前追加基础值 + public static final String SEQ_TO_STRING_LESS_INSERT = "0"; + //单据编号 + public static final String DEPOT_NUMBER_SEQ = "depot_number_seq"; + /** + * 商品类别根目录id + * */ + /** + * create by: qiankunpingtai + * create time: 2019/3/14 11:41 + * description: + * 为了使用户可以自己建初始目录,设定根目录的父级目录id为-1 + * + */ + public static final Long MATERIAL_CATEGORY_ROOT_PARENT_ID = -1L; + /** + * 商品类别状态 + * 0系统默认,1启用,2删除 + * */ + public static final String MATERIAL_CATEGORY_STATUS_DEFAULT = "0"; + public static final String MATERIAL_CATEGORY_STATUS_ENABLE = "1"; + public static final String MATERIAL_CATEGORY_STATUS_DELETE = "2"; + /** + * 机构状态 + * 1未营业、2正常营业、3暂停营业、4终止营业,5已除名 + * */ + public static final String ORGANIZATION_STCD_NOT_OPEN = "1"; + public static final String ORGANIZATION_STCD_OPEN = "2"; + public static final String ORGANIZATION_STCD_BUSINESS_SUSPENDED = "3"; + public static final String ORGANIZATION_STCD_BUSINESS_TERMINATED = "4"; + public static final String ORGANIZATION_STCD_REMOVED = "5"; + /** + * 根机构父级编号 + * 根机父级构编号默认为-1 + * */ + public static final String ORGANIZATION_ROOT_PARENT_NO = "-1"; + /** + * 新增用户默认密码 + * */ + public static final String USER_DEFAULT_PASSWORD = "123456"; + /** + * 用户是否系统自带 + * 0、非系统自带,1系统自带 + * */ + public static final byte USER_NOT_SYSTEM = 0; + public static final byte USER_IS_SYSTEM = 1; + /** + * 用户是否为管理者 + * 0、管理者,1员工 + * */ + public static final byte USER_IS_MANAGER = 0; + public static final byte USER_NOT_MANAGER = 1; + /** + * 用户状态 + * 0:正常,1:删除,2封禁 + * */ + public static final byte USER_STATUS_NORMAL = 0; + public static final byte USER_STATUS_DELETE = 1; + public static final byte USER_STATUS_BANNED = 2; + /** + * 日志操作 + * 新增、修改、删除、登录、导入 + * */ + public static final String LOG_OPERATION_TYPE_ADD = "新增"; + public static final String LOG_OPERATION_TYPE_BATCH_ADD = "批量新增"; + public static final String LOG_OPERATION_TYPE_EDIT = "修改"; + public static final String LOG_OPERATION_TYPE_DELETE = "删除"; + public static final String LOG_OPERATION_TYPE_LOGIN = "登录"; + public static final String LOG_OPERATION_TYPE_IMPORT = "导入"; + public static final String LOG_OPERATION_TYPE_ENABLED = "更新状态"; + + /** + * 数据数量单位 + * 条 + * */ + public static final String LOG_DATA_UNIT = "条"; + + /** + * 删除类型 + * 1正常删除 + * 2强制删除 + * */ + public static final String DELETE_TYPE_NORMAL = "1"; + public static final String DELETE_TYPE_FORCE = "2"; + + /** + * 默认管理员账号 + */ + public static final String DEFAULT_MANAGER = "admin"; + + public static final String ROLE_TYPE_PRIVATE = "个人数据"; + + public static final String ROLE_TYPE_THIS_ORG = "本机构数据"; + + /** + * redis相关 + * */ + //session的生命周期,秒 + public static final Long MAX_SESSION_IN_SECONDS=60*60*24*3L; +} diff --git a/src/main/java/com/wansensoft/erp/constants/ExceptionConstants.java b/src/main/java/com/wansensoft/erp/constants/ExceptionConstants.java new file mode 100644 index 00000000..02c72dac --- /dev/null +++ b/src/main/java/com/wansensoft/erp/constants/ExceptionConstants.java @@ -0,0 +1,542 @@ +package com.wansensoft.erp.constants; + +import com.alibaba.fastjson.JSONObject; + +public class ExceptionConstants { + /** + * code 格式 type+五位数字,例如3500000 + * ResourceInfo(value = "inOutItem", type = 35) + * + * */ + + public static final String GLOBAL_RETURNS_CODE = "code"; + public static final String GLOBAL_RETURNS_MESSAGE = "msg"; + public static final String GLOBAL_RETURNS_DATA = "data"; + + /** + * 正常返回/操作成功 + **/ + public static final int SERVICE_SUCCESS_CODE = 200; + public static final String SERVICE_SUCCESS_MSG = "操作成功"; + /** + * 数据查询异常 + */ + public static final int DATA_READ_FAIL_CODE = 300; + public static final String DATA_READ_FAIL_MSG = "数据查询异常"; + /** + * 数据写入异常 + */ + public static final int DATA_WRITE_FAIL_CODE = 301; + public static final String DATA_WRITE_FAIL_MSG = "数据写入异常"; + + /** + * 系统运行时未知错误 + **/ + public static final int SERVICE_SYSTEM_ERROR_CODE = 500; + public static final String SERVICE_SYSTEM_ERROR_MSG = "未知异常"; + /** + * 检测到存在依赖数据,是否强制删除? + **/ + public static final int DELETE_FORCE_CONFIRM_CODE = 601; + public static final String DELETE_FORCE_CONFIRM_MSG = "检测到存在依赖数据,不能删除!"; + /** + * 用户信息 + * type = 5 + * */ + //添加用户信息失败 + public static final int USER_ADD_FAILED_CODE = 500000; + public static final String USER_ADD_FAILED_MSG = "添加用户信息失败"; + //删除用户信息失败 + public static final int USER_DELETE_FAILED_CODE = 500001; + public static final String USER_DELETE_FAILED_MSG = "删除用户信息失败"; + //修改用户信息失败 + public static final int USER_EDIT_FAILED_CODE = 500002; + public static final String USER_EDIT_FAILED_MSG = "修改用户信息失败"; + //登录名已存在 + public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003; + public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名在本系统已存在"; + //用户录入数量超出限制 + public static final int USER_OVER_LIMIT_FAILED_CODE = 500004; + public static final String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系平台管理员"; + //此用户名限制使用 + public static final int USER_NAME_LIMIT_USE_CODE = 500005; + public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用"; + //启用的用户数量超出限制 + public static final int USER_ENABLE_OVER_LIMIT_FAILED_CODE = 500006; + public static final String USER_ENABLE_OVER_LIMIT_FAILED_MSG = "启用的用户数量超出限制,请联系平台管理员"; + //租户不能被删除 + public static final int USER_LIMIT_TENANT_DELETE_CODE = 500008; + public static final String USER_LIMIT_TENANT_DELETE_MSG = "抱歉,租户不能被删除"; + //当前机构已经存在经理 + public static final int USER_LEADER_IS_EXIST_CODE = 500009; + public static final String USER_LEADER_IS_EXIST_MSG = "抱歉,当前机构已经存在经理"; + + /** + * 角色信息 + * type = 10 + * */ + //添加角色信息失败 + public static final int ROLE_ADD_FAILED_CODE = 1000000; + public static final String ROLE_ADD_FAILED_MSG = "添加角色信息失败"; + //删除角色信息失败 + public static final int ROLE_DELETE_FAILED_CODE = 1000001; + public static final String ROLE_DELETE_FAILED_MSG = "删除角色信息失败"; + //修改角色信息失败 + public static final int ROLE_EDIT_FAILED_CODE = 1000002; + public static final String ROLE_EDIT_FAILED_MSG = "修改角色信息失败"; + /** + * 应用信息 + * type = 15 + * */ + //添加角色信息失败 + public static final int APP_ADD_FAILED_CODE = 1500000; + public static final String APP_ADD_FAILED_MSG = "添加应用信息失败"; + //删除角色信息失败 + public static final int APP_DELETE_FAILED_CODE = 1500001; + public static final String APP_DELETE_FAILED_MSG = "删除应用信息失败"; + //修改角色信息失败 + public static final int APP_EDIT_FAILED_CODE = 1500002; + public static final String APP_EDIT_FAILED_MSG = "修改应用信息失败"; + /** + * 仓库信息 + * type = 20 + * */ + //添加仓库信息失败 + public static final int DEPOT_ADD_FAILED_CODE = 2000000; + public static final String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败"; + //删除仓库信息失败 + public static final int DEPOT_DELETE_FAILED_CODE = 2000001; + public static final String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败"; + //修改仓库信息失败 + public static final int DEPOT_EDIT_FAILED_CODE = 2000002; + public static final String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败"; + + /** + * 功能模块信息 + * type = 30 + * */ + //添加角色信息失败 + public static final int FUNCTIONS_ADD_FAILED_CODE = 3000000; + public static final String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败"; + //删除角色信息失败 + public static final int FUNCTIONS_DELETE_FAILED_CODE = 3000001; + public static final String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败"; + //修改角色信息失败 + public static final int FUNCTIONS_EDIT_FAILED_CODE = 3000002; + public static final String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败"; + /** + * 收支项目信息 + * type = 35 + * */ + //添加收支项目信息失败 + public static final int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000; + public static final String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败"; + //删除收支项目信息失败 + public static final int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001; + public static final String IN_OUT_ITEM_DELETE_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 + * */ + //添加多单位信息失败 + public static final int UNIT_ADD_FAILED_CODE = 4000000; + public static final String UNIT_ADD_FAILED_MSG = "添加多单位信息失败"; + //删除多单位信息失败 + public static final int UNIT_DELETE_FAILED_CODE = 4000001; + public static final String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败"; + //修改多单位信息失败 + public static final int UNIT_EDIT_FAILED_CODE = 4000002; + public static final String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败"; + /** + * 经手人信息 + * type = 45 + * */ + //添加经手人信息失败 + public static final int PERSON_ADD_FAILED_CODE = 4500000; + public static final String PERSON_ADD_FAILED_MSG = "添加经手人信息失败"; + //删除经手人信息失败 + public static final int PERSON_DELETE_FAILED_CODE = 4500001; + public static final String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败"; + //修改经手人信息失败 + public static final int PERSON_EDIT_FAILED_CODE = 4500002; + public static final String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败"; + /** + * 用户角色模块关系信息 + * type = 50 + * */ + //添加用户角色模块关系信息失败 + public static final int USER_BUSINESS_ADD_FAILED_CODE = 5000000; + public static final String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败"; + //删除用户角色模块关系信息失败 + public static final int USER_BUSINESS_DELETE_FAILED_CODE = 5000001; + public static final String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败"; + //修改用户角色模块关系信息失败 + public static final int USER_BUSINESS_EDIT_FAILED_CODE = 5000002; + public static final String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败"; + /** + * 系统参数信息 + * type = 55 + * */ + //添加系统参数信息失败 + public static final int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000; + public static final String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败"; + //删除系统参数信息失败 + public static final int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001; + public static final String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败"; + //修改系统参数信息失败 + public static final int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002; + public static final String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败"; + /** + * 商品扩展信息 + * type = 60 + * */ + //添加商品扩展信息失败 + public static final int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000; + public static final String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败"; + //删除商品扩展信息失败 + public static final int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001; + public static final String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败"; + //修改商品扩展信息失败 + public static final int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002; + public static final String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败"; + /** + * 账户信息 + * type = 65 + * */ + //添加账户信息失败 + public static final int ACCOUNT_ADD_FAILED_CODE = 6500000; + public static final String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败"; + //删除账户信息失败 + public static final int ACCOUNT_DELETE_FAILED_CODE = 6500001; + public static final String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败"; + //修改账户信息失败 + public static final int ACCOUNT_EDIT_FAILED_CODE = 6500002; + public static final String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败"; + /** + * 供应商信息 + * type = 70 + * */ + //添加供应商信息失败 + public static final int SUPPLIER_ADD_FAILED_CODE = 7000000; + public static final String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败"; + //删除供应商信息失败 + public static final int SUPPLIER_DELETE_FAILED_CODE = 7000001; + public static final String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败"; + //修改供应商信息失败 + public static final int SUPPLIER_EDIT_FAILED_CODE = 7000002; + public static final String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败"; + /** + * 商品类别信息 + * type = 75 + * */ + //添加商品类别信息失败 + public static final int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000; + public static final String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败"; + //删除商品类别信息失败 + public static final int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001; + public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; + //修改商品类别信息失败 + public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; + public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败"; + //商品类别编号已存在 + public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003; + public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在"; + //根类别不支持修改 + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004; + public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根类别不支持修改"; + //根类别不支持删除 + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005; + public static final String MATERIAL_CATEGORY_ROOT_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 + * */ + //商品信息不存在 + public static final int MATERIAL_NOT_EXISTS_CODE = 8000000; + public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在"; + //商品信息不唯一 + public static final int MATERIAL_NOT_ONLY_CODE = 8000001; + public static final String MATERIAL_NOT_ONLY_MSG = "商品信息不唯一"; + //该商品未开启序列号 + public static final int MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE = 8000002; + public static final String MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG = "该商品未开启序列号功能"; + //商品的序列号不能为空 + public static final int MATERIAL_SERIAL_NUMBERE_EMPTY_CODE = 8000003; + public static final String MATERIAL_SERIAL_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的序列号不能为空"; + //商品库存不足 + public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004; + public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; + //商品条码重复 + public static final int MATERIAL_BARCODE_EXISTS_CODE = 8000005; + public static final String MATERIAL_BARCODE_EXISTS_MSG = "商品条码:%s重复"; + //商品-单位匹配不上 + public static final int MATERIAL_UNIT_MATE_CODE = 8000006; + public static final String MATERIAL_UNIT_MATE_MSG = "抱歉,商品条码:%s的单位匹配不上,请完善计量单位信息!"; + //商品条码长度应该为4到40位 + public static final int MATERIAL_BARCODE_LENGTH_ERROR_CODE = 8000007; + public static final String MATERIAL_BARCODE_LENGTH_ERROR_MSG = "商品条码长度应该为4到40位"; + //序列号和批号只能有一项 + public static final int MATERIAL_ENABLE_MUST_ONE_CODE = 8000008; + public static final String MATERIAL_ENABLE_MUST_ONE_MSG = "抱歉,商品条码:%s的序列号和批号不能同时填1"; + //抱歉,文件扩展名必须为xls + public static final int MATERIAL_EXTENSION_ERROR_CODE = 8000009; + public static final String MATERIAL_EXTENSION_ERROR_MSG = "抱歉,文件扩展名必须为xls"; + //名称为空 + public static final int MATERIAL_NAME_EMPTY_CODE = 8000010; + public static final String MATERIAL_NAME_EMPTY_MSG = "第%s行名称为空"; + //基本单位为空 + public static final int MATERIAL_UNIT_EMPTY_CODE = 8000011; + public static final String MATERIAL_UNIT_EMPTY_MSG = "第%s行基本单位为空"; + //状态格式错误 + public static final int MATERIAL_ENABLED_ERROR_CODE = 8000012; + public static final String MATERIAL_ENABLED_ERROR_MSG = "第%s行状态格式错误"; + //单次导入超出1000条 + public static final int MATERIAL_IMPORT_OVER_LIMIT_CODE = 8000013; + public static final String MATERIAL_IMPORT_OVER_LIMIT_MSG = "抱歉,单次导入不能超出1000条"; + //基础重量格式错误 + public static final int MATERIAL_WEIGHT_NOT_DECIMAL_CODE = 8000014; + public static final String MATERIAL_WEIGHT_NOT_DECIMAL_MSG = "第%s行基础重量格式错误"; + //保质期格式错误 + public static final int MATERIAL_EXPIRY_NUM_NOT_INTEGER_CODE = 8000015; + public static final String MATERIAL_EXPIRY_NUM_NOT_INTEGER_MSG = "第%s行保质期格式错误"; + //比例格式错误 + public static final int MATERIAL_RATIO_NOT_INTEGER_CODE = 8000016; + public static final String MATERIAL_RATIO_NOT_INTEGER_MSG = "第%s行比例格式错误"; + //组装拆卸单不能选择批号或序列号商品 + public static final int MATERIAL_ASSEMBLE_SELECT_ERROR_CODE = 80000017; + public static final String MATERIAL_ASSEMBLE_SELECT_ERROR_MSG = "抱歉,组装拆卸单不能选择批号或序列号商品:%s"; + //调拨单不能选择批号或序列号商品 + public static final int MATERIAL_TRANSFER_SELECT_ERROR_CODE = 80000018; + public static final String MATERIAL_TRANSFER_SELECT_ERROR_MSG = "抱歉,调拨单不能选择批号或序列号商品:%s,建议走其它入库和出库单"; + //盘点业务不能选择批号或序列号商品 + public static final int MATERIAL_STOCK_CHECK_ERROR_CODE = 80000019; + public static final String MATERIAL_STOCK_CHECK_ERROR_MSG = "抱歉,盘点业务不能选择批号或序列号商品:%s,建议走其它入库和出库单"; + //EXCEL中存在重复的商品 + public static final int MATERIAL_EXCEL_IMPORT_EXIST_CODE = 80000020; + public static final String MATERIAL_EXCEL_IMPORT_EXIST_MSG = "抱歉,EXCEL中存在重复的商品,具体信息为:%s"; + //EXCEL中存在重复的条码 + public static final int MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_CODE = 80000021; + public static final String MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_MSG = "抱歉,EXCEL中存在重复的条码,具体条码为:%s"; + //名称长度超出 + public static final int MATERIAL_NAME_OVER_CODE = 8000022; + public static final String MATERIAL_NAME_OVER_MSG = "第%s行名称长度超出100个字符"; + //规格长度超出 + public static final int MATERIAL_STANDARD_OVER_CODE = 8000023; + public static final String MATERIAL_STANDARD_OVER_MSG = "第%s行规格长度超出100个字符"; + //型号长度超出 + public static final int MATERIAL_MODEL_OVER_CODE = 8000024; + public static final String MATERIAL_MODEL_OVER_MSG = "第%s行型号长度超出100个字符"; + //多属性商品不能输入库存,建议进行盘点录入 + public static final int MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE = 8000025; + public static final String MATERIAL_SKU_BEGIN_STOCK_FAILED_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 + * */ + //添加单据信息失败 + public static final int DEPOT_HEAD_ADD_FAILED_CODE = 8500000; + public static final String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败"; + //删除单据信息失败 + public static final int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001; + public static final String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败"; + //修改单据信息失败 + public static final int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002; + public static final String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败"; + //单据录入-仓库不能为空 + public static final int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004; + public static final String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空"; + //单据录入-调入仓库不能为空 + public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空"; + //单据录入-明细不能为空 + public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006; + public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + //单据录入-账户不能为空 + public static final int DEPOT_HEAD_ACCOUNT_FAILED_CODE = 8500007; + public static final String DEPOT_HEAD_ACCOUNT_FAILED_MSG = "结算账户不能为空"; + //单据录入-请修改多账户的结算金额 + public static final int DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE = 8500008; + public static final String DEPOT_HEAD_MANY_ACCOUNT_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 = "调入仓库与原仓库不能重复"; + //单据删除-只有未审核的单据才能删除 + public static final int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011; + public static final String DEPOT_HEAD_UN_AUDIT_DELETE_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 = "抱歉,只有未审核的单据才能审核"; + //单据反审核-只有已审核的单据才能反审核 + 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的数量需要修改下 + public static final int DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE = 85000014; + public static final String DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG = "商品条码%s的数量需要修改下"; + //单据录入-商品的批号不能为空 + public static final int DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE = 8500015; + public static final String DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的批号不能为空"; + //单据录入-会员预付款余额不足 + public static final int DEPOT_HEAD_MEMBER_PAY_LACK_CODE = 8500016; + public static final String DEPOT_HEAD_MEMBER_PAY_LACK_MSG = "抱歉,会员预付款余额不足"; + //单据录入-累计订金超出原订单中的订金 + public static final int DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE = 8500017; + public static final String DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG = "抱歉,累计订金超出原订单中的订金"; + //单据录入-商品条码XXX的单价低于最低售价 + public static final int DEPOT_HEAD_UNIT_PRICE_LOW_CODE = 8500018; + public static final String DEPOT_HEAD_UNIT_PRICE_LOW_MSG = "商品条码%s的单价低于最低售价"; + //单据录入-单据明细中必须要有组合件和普通子件 + public static final int DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_CODE = 8500020; + public static final String DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_MSG = "抱歉,单据明细中必须要有组合件和普通子件"; + //单据录入-商品条码XXX的数量与序列号不一致 + public static final int DEPOT_HEAD_SN_NUMBERE_FAILED_CODE = 8500021; + public static final String DEPOT_HEAD_SN_NUMBERE_FAILED_MSG = "抱歉,商品条码:%s的数量与序列号不一致"; + //单据录入-单据编号已经存在 + public static final int DEPOT_HEAD_BILL_NUMBER_EXIST_CODE = 8500022; + public static final String DEPOT_HEAD_BILL_NUMBER_EXIST_MSG = "抱歉,单据编号已经存在"; + //单据录入-单据当前状态下不能修改 + public static final int DEPOT_HEAD_BILL_CANNOT_EDIT_CODE = 8500023; + public static final String DEPOT_HEAD_BILL_CANNOT_EDIT_MSG = "抱歉,单据当前状态下不能修改"; + //单据删除-单据中的序列号已经出库,不能删除 + public static final int DEPOT_HEAD_SERIAL_IS_SELL_CODE = 8500024; + public static final String DEPOT_HEAD_SERIAL_IS_SELL_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 + * */ + //添加单据明细信息失败 + public static final int DEPOT_ITEM_ADD_FAILED_CODE = 9000000; + public static final String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败"; + //删除单据明细信息失败 + public static final int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001; + public static final String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败"; + //修改单据明细信息失败 + public static final int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002; + public static final String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败"; + //单据明细-明细中商品不存在 + 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 + * */ + //添加财务信息失败 + public static final int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000; + public static final String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败"; + //删除财务信息失败 + public static final int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001; + public static final String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败"; + //修改财务信息失败 + public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002; + public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败"; + //单据录入-明细不能为空 + public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003; + public static final String ACCOUNT_HEAD_ROW_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 = "抱歉,只有未审核的单据才能删除"; + //财务信息录入-单据编号已经存在 + public static final int ACCOUNT_HEAD_BILL_NO_EXIST_CODE = 9500005; + public static final String ACCOUNT_HEAD_BILL_NO_EXIST_MSG = "抱歉,单据编号已经存在"; + /** + * 财务明细信息 + * type = 100 + * */ + //添加财务明细信息失败 + public static final int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000; + public static final String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败"; + //删除财务明细信息失败 + public static final int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001; + public static final String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败"; + //修改财务明细信息失败 + public static final int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002; + public static final String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败"; + /** + * 序列号 + * type = 105 + * */ + /**序列号已存在*/ + public static final int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000; + public static final String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号:%s已存在"; + /**序列号不能为为空*/ + public static final int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500001; + public static final String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空"; + /**商品%s下序列号不充足,请补充后重试*/ + public static final int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002; + public static final String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足,请补充后重试"; + /**删序列号信息失败*/ + public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003; + public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败"; + /** + * 机构信息 + * type = 110 + * */ + //添加机构信息失败 + public static final int ORGANIZATION_ADD_FAILED_CODE = 11000000; + public static final String ORGANIZATION_ADD_FAILED_MSG = "添加机构信息失败"; + //删除机构信息失败 + public static final int ORGANIZATION_DELETE_FAILED_CODE = 11000001; + public static final String ORGANIZATION_DELETE_FAILED_MSG = "删除机构信息失败"; + //修改机构信息失败 + public static final int ORGANIZATION_EDIT_FAILED_CODE = 11000002; + public static final String ORGANIZATION_EDIT_FAILED_MSG = "修改机构信息失败"; + //机构编号已存在 + public static final int ORGANIZATION_NO_ALREADY_EXISTS_CODE = 11000003; + public static final String ORGANIZATION_NO_ALREADY_EXISTS_MSG = "机构编号已存在"; + //根机构不允许删除 + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE = 11000004; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG = "根机构不允许删除"; + //根机构不允许修改 + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改"; + //该机构存在下级不允许删除 + public static final int ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE = 11000006; + public static final String ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG = "该机构存在下级不允许删除"; + /** + * 机构用户关联关系 + * type = 115 + * */ + //添加机构用户关联关系失败 + public static final int ORGA_USER_REL_ADD_FAILED_CODE = 11500000; + public static final String ORGA_USER_REL_ADD_FAILED_MSG = "添加机构用户关联关系失败"; + //删除机构用户关联关系失败 + public static final int ORGA_USER_REL_DELETE_FAILED_CODE = 11500001; + public static final String ORGA_USER_REL_DELETE_FAILED_MSG = "删除机构用户关联关系失败"; + //修改机构用户关联关系失败 + public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002; + public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败"; + + //进销存统计,如果有权限的仓库数量太多则提示要选择仓库 + public static final int REPORT_TWO_MANY_DEPOT_FAILED_CODE = 510; + public static final String REPORT_TWO_MANY_DEPOT_FAILED_MSG = "请选择仓库,再进行查询"; + + //演示用户禁止操作 + public static final int SYSTEM_CONFIG_TEST_USER_CODE = -1; + public static final String SYSTEM_CONFIG_TEST_USER_MSG = "演示用户禁止操作"; + + + /** + * 标准正常返回/操作成功返回 + * @return + */ + public static JSONObject standardSuccess () { + JSONObject success = new JSONObject(); + success.put(GLOBAL_RETURNS_CODE, SERVICE_SUCCESS_CODE); + success.put(GLOBAL_RETURNS_MESSAGE, SERVICE_SUCCESS_MSG); + return success; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/AccountController.java b/src/main/java/com/wansensoft/erp/controller/AccountController.java new file mode 100644 index 00000000..bc1a1292 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/AccountController.java @@ -0,0 +1,204 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Account; +import com.wansensoft.erp.datasource.vo.AccountVo4InOutList; +import com.wansensoft.erp.service.account.AccountService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author jishenghua 75271*8920 + */ +@RestController +@RequestMapping(value = "/account") +@Api(tags = {"账户管理"}) +public class AccountController { + private Logger logger = LoggerFactory.getLogger(AccountController.class); + + @Resource + private AccountService accountService; + + @Resource + private 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/src/main/java/com/wansensoft/erp/controller/AccountHeadController.java b/src/main/java/com/wansensoft/erp/controller/AccountHeadController.java new file mode 100644 index 00000000..0bb0075f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/AccountHeadController.java @@ -0,0 +1,139 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.AccountHead; +import com.wansensoft.erp.datasource.entities.AccountHeadVo4Body; +import com.wansensoft.erp.datasource.entities.AccountHeadVo4ListEx; +import com.wansensoft.erp.service.accountHead.AccountHeadService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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; + +/** + * @author jishenghua 752*718*920 + */ +@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.size()>0) { + ahl = list.get(0); + } + res.code = 200; + res.data = ahl; + } catch(Exception e){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/AccountItemController.java b/src/main/java/com/wansensoft/erp/controller/AccountItemController.java new file mode 100644 index 00000000..3b9cdd50 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/AccountItemController.java @@ -0,0 +1,93 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.vo.AccountItemVo4List; +import com.wansensoft.erp.service.accountHead.AccountHeadService; +import com.wansensoft.erp.service.accountItem.AccountItemService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @author ji sheng hua 752*718*920 + */ +@RestController +@RequestMapping(value = "/accountItem") +@Api(tags = {"财务明细"}) +public class AccountItemController { + private Logger logger = LoggerFactory.getLogger(AccountItemController.class); + + @Resource + private AccountItemService accountItemService; + + @Resource + private 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/src/main/java/com/wansensoft/erp/controller/DepotController.java b/src/main/java/com/wansensoft/erp/controller/DepotController.java new file mode 100644 index 00000000..c0905e12 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/DepotController.java @@ -0,0 +1,219 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Depot; +import com.wansensoft.erp.datasource.entities.DepotEx; +import com.wansensoft.erp.datasource.entities.MaterialInitialStock; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.material.MaterialService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.*; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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.math.BigDecimal; +import java.util.*; + +/** + * @author ji sheng hua 752*718*920 + */ +@RestController +@RequestMapping(value = "/depot") +@Api(tags = {"仓库管理"}) +public class DepotController { + private Logger logger = LoggerFactory.getLogger(DepotController.class); + + @Resource + private DepotService depotService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private 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){ + e.printStackTrace(); + 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) { + 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 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){ + 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 = 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/src/main/java/com/wansensoft/erp/controller/DepotHeadController.java b/src/main/java/com/wansensoft/erp/controller/DepotHeadController.java new file mode 100644 index 00000000..f82d4db6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/DepotHeadController.java @@ -0,0 +1,539 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.DepotHead; +import com.wansensoft.erp.datasource.entities.DepotHeadVo4Body; +import com.wansensoft.erp.datasource.vo.DepotHeadVo4InDetail; +import com.wansensoft.erp.datasource.vo.DepotHeadVo4InOutMCount; +import com.wansensoft.erp.datasource.vo.DepotHeadVo4List; +import com.wansensoft.erp.datasource.vo.DepotHeadVo4StatementAccount; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.utils.*; +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.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); + + @Resource + private DepotHeadService depotHeadService; + + @Resource + private DepotService depotService; + + @Resource + private SystemConfigService systemConfigService; + + @Resource + private RedisService redisService; + + /** + * 批量设置状态-审核或者反审核 + * @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) { + for (DepotHeadVo4InDetail dhd : list) { + resList.add(dhd); + } + } + map.put("rows", resList); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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.size()>0) { + dhl = list.get(0); + } + res.code = 200; + res.data = dhl; + } catch(Exception e){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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) { + e.printStackTrace(); + 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/src/main/java/com/wansensoft/erp/controller/DepotItemController.java b/src/main/java/com/wansensoft/erp/controller/DepotItemController.java new file mode 100644 index 00000000..88fa3fad --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/DepotItemController.java @@ -0,0 +1,973 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.vo.DepotItemStockWarningCount; +import com.wansensoft.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.depotItem.DepotItemService; +import com.wansensoft.erp.service.material.MaterialService; +import com.wansensoft.erp.service.role.RoleService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.unit.UnitService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.*; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.utils.*; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.utils.*; +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.annotation.Resource; +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); + + @Resource + private DepotHeadService depotHeadService; + + @Resource + private DepotItemService depotItemService; + + @Resource + private MaterialService materialService; + + @Resource + private UnitService unitService; + + @Resource + private DepotService depotService; + + @Resource + private RoleService roleService; + + @Resource + private UserService userService; + + @Resource + private SystemConfigService systemConfigService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + /** + * 根据仓库和商品查询单据列表 + * @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.size()>0) { + 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) { + e.printStackTrace(); + 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(); + if (null != dataList) { + 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) { + e.printStackTrace(); + 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) { + e.printStackTrace(); + message = "导入失败,请检查表格内容"; + res.code = 500; + data.put("message", message); + res.data = data; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/FunctionController.java b/src/main/java/com/wansensoft/erp/controller/FunctionController.java new file mode 100644 index 00000000..f10fe1d2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/FunctionController.java @@ -0,0 +1,276 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Function; +import com.wansensoft.erp.datasource.entities.SystemConfig; +import com.wansensoft.erp.datasource.entities.UserBusiness; +import com.wansensoft.erp.service.functions.FunctionService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.utils.Tools; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author ji-sheng-hua jshERP + */ +@RestController +@RequestMapping(value = "/function") +@Api(tags = {"功能管理"}) +public class FunctionController { + private Logger logger = LoggerFactory.getLogger(FunctionController.class); + + @Resource + private FunctionService functionService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private 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.size()>0){ + 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.size()>0){ + fc = funList.get(0).getValue(); + } + //获取系统配置信息-是否开启多级审核 + String approvalFlag = "0"; + List list = systemConfigService.getSystemConfig(); + if(list.size()>0) { + approvalFlag = list.get(0).getMultiLevelApprovalFlag(); + } + List dataList = functionService.getRoleFunction(pNumber); + if (dataList.size() != 0) { + 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.size()>0) { + JSONArray childrenArr = getMenuByFunction(newList, fc, approvalFlag); + if(childrenArr.size()>0) { + item.put("children", childrenArr); + dataArray.add(item); + } + } else { + if (fc.indexOf("[" + function.getId().toString() + "]") != -1) { + 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.size()>0) { + 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.size()>0) { + //按钮 + 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(); + if (null != dataList) { + 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/src/main/java/com/wansensoft/erp/controller/InOutItemController.java b/src/main/java/com/wansensoft/erp/controller/InOutItemController.java new file mode 100644 index 00000000..0eccf07c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/InOutItemController.java @@ -0,0 +1,83 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.InOutItem; +import com.wansensoft.erp.service.inOutItem.InOutItemService; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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; + +/** + * @author jishenghua jshERP 2018年12月25日14:38:08 + */ +@RestController +@RequestMapping(value = "/inOutItem") +@Api(tags = {"收支项目"}) +public class InOutItemController { + private Logger logger = LoggerFactory.getLogger(InOutItemController.class); + + @Resource + private 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/src/main/java/com/wansensoft/erp/controller/MaterialAttributeController.java b/src/main/java/com/wansensoft/erp/controller/MaterialAttributeController.java new file mode 100644 index 00000000..20508598 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MaterialAttributeController.java @@ -0,0 +1,74 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.MaterialAttribute; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @author ji sheng hua jshERP + */ +@RestController +@RequestMapping(value = "/materialAttribute") +@Api(tags = {"商品属性"}) +public class MaterialAttributeController { + private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class); + + @Resource + private 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/src/main/java/com/wansensoft/erp/controller/MaterialCategoryController.java b/src/main/java/com/wansensoft/erp/controller/MaterialCategoryController.java new file mode 100644 index 00000000..8529d804 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MaterialCategoryController.java @@ -0,0 +1,155 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.MaterialCategory; +import com.wansensoft.erp.datasource.vo.TreeNode; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.service.materialCategory.MaterialCategoryService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @author ji—sheng—hua jshERP + */ +@RestController +@RequestMapping(value = "/materialCategory") +@Api(tags = {"商品类别"}) +public class MaterialCategoryController { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); + + @Resource + private 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.size()>0){ + 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; + } + /** + * create by: cjl + * description: + * 获取商品类别树数据 + * create time: 2019/2/19 11:49 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getMaterialCategoryTree") + @ApiOperation(value = "获取商品类别树数据") + public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id); + if(materialCategoryTree!=null&&materialCategoryTree.size()>0){ + for(TreeNode node:materialCategoryTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + /** + * create by: cjl + * description: + * 新增商品类别数据 + * create time: 2019/2/19 17:17 + * @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; + } + /** + * create by: cjl + * description: + * 修改商品类别数据 + * create time: 2019/2/20 9:30 + * @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/src/main/java/com/wansensoft/erp/controller/MaterialController.java b/src/main/java/com/wansensoft/erp/controller/MaterialController.java new file mode 100644 index 00000000..c5370340 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MaterialController.java @@ -0,0 +1,662 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.MaterialExtend; +import com.wansensoft.erp.datasource.entities.MaterialVo4Unit; +import com.wansensoft.erp.datasource.entities.Unit; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotItem.DepotItemService; +import com.wansensoft.erp.service.material.MaterialService; +import com.wansensoft.erp.service.unit.UnitService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +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 jshERP + */ +@RestController +@RequestMapping(value = "/material") +@Api(tags = {"商品管理"}) +public class MaterialController { + private Logger logger = LoggerFactory.getLogger(MaterialController.class); + + @Resource + private MaterialService materialService; + + @Resource + private DepotItemService depotItemService; + + @Resource + private UnitService unitService; + + @Resource + private DepotService depotService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + /** + * 检查商品是否存在 + * @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.size()>0) { + mu = list.get(0); + mu.setMaterialOther(materialService.getMaterialOtherByParam(mpArr, mu)); + } + res.code = 200; + res.data = mu; + } catch(Exception e){ + e.printStackTrace(); + 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) { + e.printStackTrace(); + 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 || material.getUnitId().equals("")) { + 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.size()>0) { + 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据商品信息获取库存,进行赋值 + * @param mvo + * @throws Exception + */ + private void getStockByMaterialInfo(MaterialVo4Unit mvo) throws Exception { + 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)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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 + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/batchUpdate") + @ApiOperation(value = "批量更新商品信息") + public String batchUpdate(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + 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/src/main/java/com/wansensoft/erp/controller/MaterialExtendController.java b/src/main/java/com/wansensoft/erp/controller/MaterialExtendController.java new file mode 100644 index 00000000..c8309751 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MaterialExtendController.java @@ -0,0 +1,132 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.MaterialExtend; +import com.wansensoft.erp.datasource.vo.MaterialExtendVo4List; +import com.wansensoft.erp.service.materialExtend.MaterialExtendService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.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.*; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author jijiaqing + */ +@RestController +@RequestMapping(value = "/materialsExtend") +@Api(tags = {"商品价格扩展"}) +public class MaterialExtendController { + private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class); + @Resource + private 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(); + if (null != dataList) { + 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) { + e.printStackTrace(); + 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) { + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/MaterialPropertyController.java b/src/main/java/com/wansensoft/erp/controller/MaterialPropertyController.java new file mode 100644 index 00000000..25638720 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MaterialPropertyController.java @@ -0,0 +1,46 @@ +package com.wansensoft.erp.controller; + +import com.wansensoft.erp.datasource.entities.MaterialProperty; +import com.wansensoft.erp.service.materialProperty.MaterialPropertyService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/29 15:24 + */ +@RestController +@RequestMapping(value = "/materialProperty") +@Api(tags = {"商品扩展字段"}) +public class MaterialPropertyController { + + @Resource + private 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + +} diff --git a/src/main/java/com/wansensoft/erp/controller/MsgController.java b/src/main/java/com/wansensoft/erp/controller/MsgController.java new file mode 100644 index 00000000..048aba9f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/MsgController.java @@ -0,0 +1,154 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.MsgEx; +import com.wansensoft.erp.service.msg.MsgService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author ji sheng hua jshERP + */ +@RestController +@RequestMapping(value = "/msg") +@Api(tags = {"消息管理"}) +public class MsgController { + private Logger logger = LoggerFactory.getLogger(MsgController.class); + + @Resource + private 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){ + e.printStackTrace(); + 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)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 全部设置未已读 + * @param request + * @return + * @throws Exception + */ + @PostMapping("/readAllMsg") + @ApiOperation(value = "全部设置未已读") + public BaseResponseInfo readAllMsg(HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + msgService.readAllMsg(); + res.code = 200; + res.data = "操作成功!"; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/OrganizationController.java b/src/main/java/com/wansensoft/erp/controller/OrganizationController.java new file mode 100644 index 00000000..b6f90db3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/OrganizationController.java @@ -0,0 +1,138 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.Organization; +import com.wansensoft.erp.datasource.vo.TreeNode; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.service.organization.OrganizationService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * create by: cjl + * description: + * + * create time: 2019/3/6 10:54 + */ +@RestController +@RequestMapping(value = "/organization") +@Api(tags = {"机构管理"}) +public class OrganizationController { + private Logger logger = LoggerFactory.getLogger(OrganizationController.class); + + @Resource + private 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.size()>0){ + //父级机构名称显示简称 + 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; + } + + /** + * create by: cjl + * description: + * 获取机构树数据 + * create time: 2019/2/19 11:49 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getOrganizationTree") + @ApiOperation(value = "获取机构树数据") + public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List organizationTree= organizationService.getOrganizationTree(id); + if(organizationTree!=null&&organizationTree.size()>0){ + for(TreeNode node:organizationTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj); + } + } + return arr; + } + /** + * create by: cjl + * description: + * 新增机构信息 + * create time: 2019/2/19 17:17 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/addOrganization") + @ApiOperation(value = "新增机构信息") + public Object addOrganization(@RequestParam("info") String beanJson) throws Exception { + 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; + } + /** + * create by: cjl + * description: + * 修改机构信息 + * create time: 2019/2/20 9:30 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/editOrganization") + @ApiOperation(value = "修改机构信息") + public Object editOrganization(@RequestParam("info") String beanJson) throws Exception { + 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/src/main/java/com/wansensoft/erp/controller/PersonController.java b/src/main/java/com/wansensoft/erp/controller/PersonController.java new file mode 100644 index 00000000..2281c607 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/PersonController.java @@ -0,0 +1,164 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Person; +import com.wansensoft.erp.service.person.PersonService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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; + +/** + * @author ji|sheng|hua 华夏erp + */ +@RestController +@RequestMapping(value = "/person") +@Api(tags = {"经手人管理"}) +public class PersonController { + private Logger logger = LoggerFactory.getLogger(PersonController.class); + + @Resource + private PersonService personService; + + /** + * 全部数据列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "全部数据列表") + public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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){ + e.printStackTrace(); + 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)throws Exception { + 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/src/main/java/com/wansensoft/erp/controller/PlatformConfigController.java b/src/main/java/com/wansensoft/erp/controller/PlatformConfigController.java new file mode 100644 index 00000000..27704397 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/PlatformConfigController.java @@ -0,0 +1,135 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.PlatformConfig; +import com.wansensoft.erp.service.platformConfig.PlatformConfigService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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.Map; + +/** + * @author ji|sheng|hua 华夏erp QQ7827-18920 + */ +@RestController +@RequestMapping(value = "/platformConfig") +@Api(tags = {"平台参数"}) +public class PlatformConfigController { + private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); + + @Resource + private PlatformConfigService platformConfigService; + + /** + * 获取平台名称 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/name") + @ApiOperation(value = "获取平台名称") + public String getPlatformName(HttpServletRequest request)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + PlatformConfig platformConfig = platformConfigService.getInfoByKey(platformKey); + res.code = 200; + res.data = platformConfig; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/PluginController.java b/src/main/java/com/wansensoft/erp/controller/PluginController.java new file mode 100644 index 00000000..c8095f7e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/PluginController.java @@ -0,0 +1,362 @@ +//package com.wansensoft.erp.controller; +// +//import com.wansensoft.erp.constants.BusinessConstants; +//import com.wansensoft.erp.datasource.entities.User; +//import com.wansensoft.erp.service.user.UserService; +//import com.wansensoft.erp.utils.BaseResponseInfo; +//import com.wansensoft.erp.utils.ComputerInfo; +//import com.wansensoft.erp.utils.StringUtil; +//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.annotation.Resource; +//import jakarta.servlet.http.HttpServletRequest; +//import jakarta.servlet.http.HttpServletResponse; +//import java.nio.file.Paths; +//import java.util.*; +// +///** +// * 插件jar 包测试功能 +// * @author jishenghua +// * @version 1.0 +// */ +//@RestController +//@RequestMapping("/plugin") +//@Api(tags = {"插件管理"}) +//public class PluginController { +// +// @Resource +// private UserService userService; +// +// private final PluginOperator pluginOperator; +// +// @Autowired +// public PluginController(PluginApplication pluginApplication) { +// 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().getPluginDescription(); +// 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/src/main/java/com/wansensoft/erp/controller/ResourceController.java b/src/main/java/com/wansensoft/erp/controller/ResourceController.java new file mode 100644 index 00000000..003d96f8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/ResourceController.java @@ -0,0 +1,148 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.service.CommonQueryManager; +import com.wansensoft.erp.utils.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * by jishenghua 2018-9-12 23:58:10 华夏erp + */ +@RestController +@Api(tags = {"资源接口"}) +public class ResourceController { + + @Resource + private CommonQueryManager 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/src/main/java/com/wansensoft/erp/controller/RoleController.java b/src/main/java/com/wansensoft/erp/controller/RoleController.java new file mode 100644 index 00000000..dba88e04 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/RoleController.java @@ -0,0 +1,95 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Role; +import com.wansensoft.erp.service.role.RoleService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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; + +/** + * @author ji sheng hua jshERP + */ +@RestController +@RequestMapping(value = "/role") +@Api(tags = {"角色管理"}) +public class RoleController { + private Logger logger = LoggerFactory.getLogger(RoleController.class); + + @Resource + private RoleService roleService; + + @Resource + private UserBusinessService userBusinessService; + + /** + * 角色对应应用显示 + * @param request + * @return + */ + @GetMapping(value = "/findUserRole") + @ApiOperation(value = "查询用户的角色") + public JSONArray findUserRole(@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 = 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/src/main/java/com/wansensoft/erp/controller/SequenceController.java b/src/main/java/com/wansensoft/erp/controller/SequenceController.java new file mode 100644 index 00000000..74c518e9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/SequenceController.java @@ -0,0 +1,53 @@ +package com.wansensoft.erp.controller; + +import com.wansensoft.erp.service.sequence.SequenceService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +/** + * @author ji-sheng-hua 752*718*920 + */ +@RestController +@RequestMapping(value = "/sequence") +@Api(tags = {"单据编号"}) +public class SequenceController { + private Logger logger = LoggerFactory.getLogger(SequenceController.class); + + @Resource + private SequenceService sequenceService; + + /** + * 单据编号生成接口 + * @param request + * @return + */ + @GetMapping(value = "/buildNumber") + @ApiOperation(value = "单据编号生成接口") + public BaseResponseInfo buildNumber(HttpServletRequest request)throws Exception { + 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + +} diff --git a/src/main/java/com/wansensoft/erp/controller/SerialNumberController.java b/src/main/java/com/wansensoft/erp/controller/SerialNumberController.java new file mode 100644 index 00000000..4862ee45 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/SerialNumberController.java @@ -0,0 +1,117 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.DepotItem; +import com.wansensoft.erp.datasource.entities.SerialNumberEx; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.depotItem.DepotItemService; +import com.wansensoft.erp.service.serialNumber.SerialNumberService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.Tools; +import com.wansensoft.erp.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; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/22 10:29 + */ +@RestController +@RequestMapping(value = "/serialNumber") +@Api(tags = {"序列号管理"}) +public class SerialNumberController { + private Logger logger = LoggerFactory.getLogger(SerialNumberController.class); + + @Resource + private SerialNumberService serialNumberService; + @Resource + private DepotHeadService depotHeadService; + @Resource + private DepotItemService depotItemService; + + /** + * create by: cjl + * description: + *批量添加序列号 + * create time: 2019/1/29 15:11 + * @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)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 = 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){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/src/main/java/com/wansensoft/erp/controller/SupplierController.java b/src/main/java/com/wansensoft/erp/controller/SupplierController.java new file mode 100644 index 00000000..ff53fa96 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/SupplierController.java @@ -0,0 +1,393 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Supplier; +import com.wansensoft.erp.service.supplier.SupplierService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.ExcelUtils; +import com.wansensoft.erp.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 org.springframework.web.multipart.MultipartFile; + +import jakarta.annotation.Resource; +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; + +/** + * @author ji|sheng|hua 华夏erp + */ +@RestController +@RequestMapping(value = "/supplier") +@Api(tags = {"商家管理"}) +public class SupplierController { + private Logger logger = LoggerFactory.getLogger(SupplierController.class); + + @Resource + private SupplierService supplierService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private SystemConfigService systemConfigService; + + @Resource + private 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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) throws Exception{ + 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) { + e.printStackTrace(); + 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) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importVendor(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + e.printStackTrace(); + 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) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importCustomer(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + e.printStackTrace(); + 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) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importMember(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + e.printStackTrace(); + 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/src/main/java/com/wansensoft/erp/controller/SystemConfigController.java b/src/main/java/com/wansensoft/erp/controller/SystemConfigController.java new file mode 100644 index 00000000..34dcdb3a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/SystemConfigController.java @@ -0,0 +1,285 @@ +package com.wansensoft.erp.controller; + +import com.wansensoft.erp.datasource.entities.SystemConfig; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.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 jakarta.annotation.Resource; +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; + +/** + * Description + * @Author: jishenghua + * @Date: 2021-3-13 0:01 + */ +@RestController +@RequestMapping(value = "/systemConfig") +@Api(tags = {"系统参数"}) +public class SystemConfigController { + private Logger logger = LoggerFactory.getLogger(SystemConfigController.class); + + @Resource + private UserService userService; + + @Resource + private DepotService depotService; + + @Resource + private UserBusinessService userBusinessService; + + @Resource + private SystemConfigService systemConfigService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + @Value(value="${file.path}") + private String filePath; + + @Value(value="${spring.servlet.multipart.max-file-size}") + private Long maxFileSize; + + @Value(value="${spring.servlet.multipart.max-request-size}") + private Long maxRequestSize; + + /** + * 获取当前租户的配置信息 + * @param request + * @return + */ + @GetMapping(value = "/getCurrentInfo") + @ApiOperation(value = "获取当前租户的配置信息") + public BaseResponseInfo getCurrentInfo(HttpServletRequest request) throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try{ + List list = systemConfigService.getSystemConfig(); + res.code = 200; + if(list.size()>0) { + res.data = list.get(0); + } + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 获取文件大小限制 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/fileSizeLimit") + @ApiOperation(value = "获取文件大小限制") + public BaseResponseInfo fileSizeLimit(HttpServletRequest request) throws Exception { + 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); + e.printStackTrace(); + } catch (Exception e) { + response.setStatus(404); + e.printStackTrace(); + } 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); + e.printStackTrace(); + } 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/src/main/java/com/wansensoft/erp/controller/TenantController.java b/src/main/java/com/wansensoft/erp/controller/TenantController.java new file mode 100644 index 00000000..094c6991 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/TenantController.java @@ -0,0 +1,50 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.tenant.TenantService; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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.Map; + +/** + * @author ji_sheng_hua 华夏erp + */ +@RestController +@RequestMapping(value = "/tenant") +@Api(tags = {"租户管理"}) +public class TenantController { + private Logger logger = LoggerFactory.getLogger(TenantController.class); + + @Resource + private 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/src/main/java/com/wansensoft/erp/controller/UnitController.java b/src/main/java/com/wansensoft/erp/controller/UnitController.java new file mode 100644 index 00000000..91af2bbd --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/UnitController.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.Unit; +import com.wansensoft.erp.service.unit.UnitService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/4/1 15:38 + */ +@RestController +@RequestMapping(value = "/unit") +@Api(tags = {"单位管理"}) +public class UnitController { + + @Resource + private UnitService unitService; + + /** + * 单位列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "单位列表") + public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + List unitList = unitService.getUnit(); + res.code = 200; + res.data = unitList; + } 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 = 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/src/main/java/com/wansensoft/erp/controller/UserBusinessController.java b/src/main/java/com/wansensoft/erp/controller/UserBusinessController.java new file mode 100644 index 00000000..173495e2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/UserBusinessController.java @@ -0,0 +1,115 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.datasource.entities.UserBusiness; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ErpInfo; +import com.wansensoft.erp.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; + +/** + * @author ji_sheng_hua jshERP + */ +@RestController +@RequestMapping(value = "/userBusiness") +@Api(tags = {"用户角色模块的关系"}) +public class UserBusinessController { + private Logger logger = LoggerFactory.getLogger(UserBusinessController.class); + + @Resource + private UserBusinessService userBusinessService; + @Resource + private UserService userService; + + /** + * 获取信息 + * @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)throws Exception { + 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)throws Exception { + 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/src/main/java/com/wansensoft/erp/controller/UserController.java b/src/main/java/com/wansensoft/erp/controller/UserController.java new file mode 100644 index 00000000..6ebb5fff --- /dev/null +++ b/src/main/java/com/wansensoft/erp/controller/UserController.java @@ -0,0 +1,457 @@ +package com.wansensoft.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.Tenant; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.entities.UserEx; +import com.wansensoft.erp.datasource.vo.TreeNodeEx; +import com.wansensoft.erp.exception.BusinessParamCheckingException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.role.RoleService; +import com.wansensoft.erp.service.tenant.TenantService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.*; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.util.*; + +/** + * @author ji_sheng_hua 华夏erp + */ +@RestController +@RequestMapping(value = "/user") +@Api(tags = {"用户管理"}) +public class UserController { + private Logger logger = LoggerFactory.getLogger(UserController.class); + + @Value("${manage.roleId}") + private Integer manageRoleId; + + @Resource + private UserService userService; + + @Resource + private RoleService roleService; + + @Resource + private TenantService tenantService; + + @Resource + private LogService logService; + + @Resource + private RedisService redisService; + + private static String SUCCESS = "操作成功"; + private static String ERROR = "操作失败"; + + @PostMapping(value = "/login") + @ApiOperation(value = "登录") + public BaseResponseInfo login(@RequestBody User userParam, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = userService.login(userParam, request); + res.code = 200; + res.data = data; + } catch(Exception e){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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){ + e.printStackTrace(); + 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; + } + + /** + * create by: cjl + * description: + * 新增用户及机构和用户关系 + * create time: 2019/3/8 16:06 + * @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; + } + + /** + * create by: cjl + * description: + * 修改用户及机构和用户关系 + * create time: 2019/3/8 16:06 + * @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/src/main/java/com/wansensoft/erp/datasource/entities/Account.java b/src/main/java/com/wansensoft/erp/datasource/entities/Account.java new file mode 100644 index 00000000..db601ded --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Account.java @@ -0,0 +1,115 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo == null ? null : serialNo.trim(); + } + + public BigDecimal getInitialAmount() { + return initialAmount; + } + + public void setInitialAmount(BigDecimal initialAmount) { + this.initialAmount = initialAmount; + } + + public BigDecimal getCurrentAmount() { + return currentAmount; + } + + public void setCurrentAmount(BigDecimal currentAmount) { + this.currentAmount = currentAmount; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/AccountExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountExample.java new file mode 100644 index 00000000..9655f3ec --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountExample.java @@ -0,0 +1,910 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/AccountHead.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHead.java new file mode 100644 index 00000000..7d856b67 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHead.java @@ -0,0 +1,176 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Long getOrganId() { + return organId; + } + + public void setOrganId(Long organId) { + this.organId = organId; + } + + public Long getHandsPersonId() { + return handsPersonId; + } + + public void setHandsPersonId(Long handsPersonId) { + this.handsPersonId = handsPersonId; + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(BigDecimal discountMoney) { + this.discountMoney = discountMoney; + } + + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public String getBillNo() { + return billNo; + } + + public void setBillNo(String billNo) { + this.billNo = billNo == null ? null : billNo.trim(); + } + + public Date getBillTime() { + return billTime; + } + + public void setBillTime(Date billTime) { + this.billTime = billTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source == null ? null : source.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadExample.java new file mode 100644 index 00000000..c4137fdc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadExample.java @@ -0,0 +1,1291 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4Body.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4Body.java new file mode 100644 index 00000000..cdee8a85 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4Body.java @@ -0,0 +1,34 @@ +package com.wansensoft.erp.datasource.entities; + +public class AccountHeadVo4Body { + + private Long id; + + private String info; + + private String rows; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getRows() { + return rows; + } + + public void setRows(String rows) { + this.rows = rows; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4ListEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4ListEx.java new file mode 100644 index 00000000..d740f53a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountHeadVo4ListEx.java @@ -0,0 +1,54 @@ +package com.wansensoft.erp.datasource.entities; + +public class AccountHeadVo4ListEx extends AccountHead{ + + private String organName; + + private String handsPersonName; + + private String userName; + + private String accountName; + + private String billTimeStr; + + public String getOrganName() { + return organName; + } + + public void setOrganName(String organName) { + this.organName = organName; + } + + public String getHandsPersonName() { + return handsPersonName; + } + + public void setHandsPersonName(String handsPersonName) { + this.handsPersonName = handsPersonName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getBillTimeStr() { + return billTimeStr; + } + + public void setBillTimeStr(String billTimeStr) { + this.billTimeStr = billTimeStr; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/AccountItem.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountItem.java new file mode 100644 index 00000000..395f2212 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountItem.java @@ -0,0 +1,115 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getHeaderId() { + return headerId; + } + + public void setHeaderId(Long headerId) { + this.headerId = headerId; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public Long getInOutItemId() { + return inOutItemId; + } + + public void setInOutItemId(Long inOutItemId) { + this.inOutItemId = inOutItemId; + } + + public Long getBillId() { + return billId; + } + + public void setBillId(Long billId) { + this.billId = billId; + } + + public BigDecimal getNeedDebt() { + return needDebt; + } + + public void setNeedDebt(BigDecimal needDebt) { + this.needDebt = needDebt; + } + + public BigDecimal getFinishDebt() { + return finishDebt; + } + + public void setFinishDebt(BigDecimal finishDebt) { + this.finishDebt = finishDebt; + } + + public BigDecimal getEachAmount() { + return eachAmount; + } + + public void setEachAmount(BigDecimal eachAmount) { + this.eachAmount = eachAmount; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/AccountItemExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/AccountItemExample.java new file mode 100644 index 00000000..6f176490 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/AccountItemExample.java @@ -0,0 +1,880 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Depot.java b/src/main/java/com/wansensoft/erp/datasource/entities/Depot.java new file mode 100644 index 00000000..e9763dff --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Depot.java @@ -0,0 +1,135 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public BigDecimal getWarehousing() { + return warehousing; + } + + public void setWarehousing(BigDecimal warehousing) { + this.warehousing = warehousing; + } + + public BigDecimal getTruckage() { + return truckage; + } + + public void setTruckage(BigDecimal truckage) { + this.truckage = truckage; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getPrincipal() { + return principal; + } + + public void setPrincipal(Long principal) { + this.principal = principal; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotEx.java new file mode 100644 index 00000000..a8c7e32d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotEx.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.entities; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/2/25 11:40 + */ +@Data +public class DepotEx extends Depot{ + //负责人名字 + private String principalName; + + private BigDecimal initStock; + + private BigDecimal currentStock; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + +} diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotExample.java new file mode 100644 index 00000000..dbbe9a1b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotExample.java @@ -0,0 +1,1030 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/DepotHead.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHead.java new file mode 100644 index 00000000..946c0450 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHead.java @@ -0,0 +1,316 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getSubType() { + return subType; + } + + public void setSubType(String subType) { + this.subType = subType == null ? null : subType.trim(); + } + + public String getDefaultNumber() { + return defaultNumber; + } + + public void setDefaultNumber(String defaultNumber) { + this.defaultNumber = defaultNumber == null ? null : defaultNumber.trim(); + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number == null ? null : number.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getOperTime() { + return operTime; + } + + public void setOperTime(Date operTime) { + this.operTime = operTime; + } + + public Long getOrganId() { + return organId; + } + + public void setOrganId(Long organId) { + this.organId = organId; + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getBackAmount() { + return backAmount; + } + + public void setBackAmount(BigDecimal backAmount) { + this.backAmount = backAmount; + } + + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType == null ? null : payType.trim(); + } + + public String getBillType() { + return billType; + } + + public void setBillType(String billType) { + this.billType = billType == null ? null : billType.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + public String getSalesMan() { + return salesMan; + } + + public void setSalesMan(String salesMan) { + this.salesMan = salesMan == null ? null : salesMan.trim(); + } + + public String getAccountIdList() { + return accountIdList; + } + + public void setAccountIdList(String accountIdList) { + this.accountIdList = accountIdList == null ? null : accountIdList.trim(); + } + + public String getAccountMoneyList() { + return accountMoneyList; + } + + public void setAccountMoneyList(String accountMoneyList) { + this.accountMoneyList = accountMoneyList == null ? null : accountMoneyList.trim(); + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public BigDecimal getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(BigDecimal discountMoney) { + this.discountMoney = discountMoney; + } + + public BigDecimal getDiscountLastMoney() { + return discountLastMoney; + } + + public void setDiscountLastMoney(BigDecimal discountLastMoney) { + this.discountLastMoney = discountLastMoney; + } + + public BigDecimal getOtherMoney() { + return otherMoney; + } + + public void setOtherMoney(BigDecimal otherMoney) { + this.otherMoney = otherMoney; + } + + public BigDecimal getDeposit() { + return deposit; + } + + public void setDeposit(BigDecimal deposit) { + this.deposit = deposit; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getPurchaseStatus() { + return purchaseStatus; + } + + public void setPurchaseStatus(String purchaseStatus) { + this.purchaseStatus = purchaseStatus == null ? null : purchaseStatus.trim(); + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source == null ? null : source.trim(); + } + + public String getLinkNumber() { + return linkNumber; + } + + public void setLinkNumber(String linkNumber) { + this.linkNumber = linkNumber == null ? null : linkNumber.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadExample.java new file mode 100644 index 00000000..1c6150e9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadExample.java @@ -0,0 +1,2221 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadVo4Body.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadVo4Body.java new file mode 100644 index 00000000..3e8c20e1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotHeadVo4Body.java @@ -0,0 +1,46 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +public class DepotHeadVo4Body { + + private Long id; + + private String info; + + private String rows; + + private BigDecimal preTotalPrice; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getRows() { + return rows; + } + + public void setRows(String rows) { + this.rows = rows; + } + + public BigDecimal getPreTotalPrice() { + return preTotalPrice; + } + + public void setPreTotalPrice(BigDecimal preTotalPrice) { + this.preTotalPrice = preTotalPrice; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotItem.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItem.java new file mode 100644 index 00000000..b5442280 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItem.java @@ -0,0 +1,256 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getHeaderId() { + return headerId; + } + + public void setHeaderId(Long headerId) { + this.headerId = headerId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getMaterialExtendId() { + return materialExtendId; + } + + public void setMaterialExtendId(Long materialExtendId) { + this.materialExtendId = materialExtendId; + } + + public String getMaterialUnit() { + return materialUnit; + } + + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit == null ? null : materialUnit.trim(); + } + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku == null ? null : sku.trim(); + } + + public BigDecimal getOperNumber() { + return operNumber; + } + + public void setOperNumber(BigDecimal operNumber) { + this.operNumber = operNumber; + } + + public BigDecimal getBasicNumber() { + return basicNumber; + } + + public void setBasicNumber(BigDecimal basicNumber) { + this.basicNumber = basicNumber; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getPurchaseUnitPrice() { + return purchaseUnitPrice; + } + + public void setPurchaseUnitPrice(BigDecimal purchaseUnitPrice) { + this.purchaseUnitPrice = purchaseUnitPrice; + } + + public BigDecimal getTaxUnitPrice() { + return taxUnitPrice; + } + + public void setTaxUnitPrice(BigDecimal taxUnitPrice) { + this.taxUnitPrice = taxUnitPrice; + } + + public BigDecimal getAllPrice() { + return allPrice; + } + + public void setAllPrice(BigDecimal allPrice) { + this.allPrice = allPrice; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public Long getAnotherDepotId() { + return anotherDepotId; + } + + public void setAnotherDepotId(Long anotherDepotId) { + this.anotherDepotId = anotherDepotId; + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public BigDecimal getTaxMoney() { + return taxMoney; + } + + public void setTaxMoney(BigDecimal taxMoney) { + this.taxMoney = taxMoney; + } + + public BigDecimal getTaxLastMoney() { + return taxLastMoney; + } + + public void setTaxLastMoney(BigDecimal taxLastMoney) { + this.taxLastMoney = taxLastMoney; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType == null ? null : materialType.trim(); + } + + public String getSnList() { + return snList; + } + + public void setSnList(String snList) { + this.snList = snList == null ? null : snList.trim(); + } + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber == null ? null : batchNumber.trim(); + } + + public Date getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + public Long getLinkId() { + return linkId; + } + + public void setLinkId(Long linkId) { + this.linkId = linkId; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemExample.java new file mode 100644 index 00000000..ecfbf853 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemExample.java @@ -0,0 +1,1771 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java new file mode 100644 index 00000000..3976e031 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java @@ -0,0 +1,87 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getSubType() { + return subType; + } + + public void setSubType(String subType) { + this.subType = subType; + } + + public BigDecimal getBnum() { + return bnum; + } + + public void setBnum(BigDecimal bnum) { + this.bnum = bnum; + } + + public String getDepotName() { + return depotName; + } + + public void setDepotName(String depotName) { + this.depotName = depotName; + } + + public Date getOtime() { + return otime; + } + + public void setOtime(Date otime) { + this.otime = otime; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4Material.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4Material.java new file mode 100644 index 00000000..f206d9e4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4Material.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.datasource.entities; + +public class DepotItemVo4Material extends DepotItem{ + + private String mname; + + private String mmodel; + + public String getMname() { + return mname; + } + + public void setMname(String mname) { + this.mname = mname; + } + + public String getMmodel() { + return mmodel; + } + + public void setMmodel(String mmodel) { + this.mmodel = mmodel; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4MaterialAndSum.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4MaterialAndSum.java new file mode 100644 index 00000000..d23f1e13 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4MaterialAndSum.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +public class DepotItemVo4MaterialAndSum { + + private Long materialExtendId; + + private BigDecimal operNumber; + + public Long getMaterialExtendId() { + return materialExtendId; + } + + public void setMaterialExtendId(Long materialExtendId) { + this.materialExtendId = materialExtendId; + } + + public BigDecimal getOperNumber() { + return operNumber; + } + + public void setOperNumber(BigDecimal operNumber) { + this.operNumber = operNumber; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4WithInfoEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4WithInfoEx.java new file mode 100644 index 00000000..624c17f0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/DepotItemVo4WithInfoEx.java @@ -0,0 +1,246 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getMId() { + return MId; + } + + public void setMId(Long MId) { + this.MId = MId; + } + + public String getMName() { + return MName; + } + + public void setMName(String MName) { + this.MName = MName; + } + + public String getMModel() { + return MModel; + } + + public void setMModel(String MModel) { + this.MModel = MModel; + } + + public String getMaterialUnit() { + return MaterialUnit; + } + + public void setMaterialUnit(String materialUnit) { + MaterialUnit = materialUnit; + } + + public String getMColor() { + return MColor; + } + + public void setMColor(String MColor) { + this.MColor = MColor; + } + + public String getMStandard() { + return MStandard; + } + + public void setMStandard(String MStandard) { + this.MStandard = MStandard; + } + + public String getMMfrs() { + return MMfrs; + } + + public void setMMfrs(String MMfrs) { + this.MMfrs = MMfrs; + } + + public String getMOtherField1() { + return MOtherField1; + } + + public void setMOtherField1(String MOtherField1) { + this.MOtherField1 = MOtherField1; + } + + public String getMOtherField2() { + return MOtherField2; + } + + public void setMOtherField2(String MOtherField2) { + this.MOtherField2 = MOtherField2; + } + + public String getMOtherField3() { + return MOtherField3; + } + + public void setMOtherField3(String MOtherField3) { + this.MOtherField3 = MOtherField3; + } + + public String getEnableSerialNumber() { + return enableSerialNumber; + } + + public void setEnableSerialNumber(String enableSerialNumber) { + this.enableSerialNumber = enableSerialNumber; + } + + public String getEnableBatchNumber() { + return enableBatchNumber; + } + + public void setEnableBatchNumber(String enableBatchNumber) { + this.enableBatchNumber = enableBatchNumber; + } + + public String getDepotName() { + return DepotName; + } + + public void setDepotName(String depotName) { + DepotName = depotName; + } + + public String getAnotherDepotName() { + return AnotherDepotName; + } + + public void setAnotherDepotName(String anotherDepotName) { + AnotherDepotName = anotherDepotName; + } + + public Long getUnitId() { + return UnitId; + } + + public void setUnitId(Long unitId) { + UnitId = unitId; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public Integer getRatio() { + return ratio; + } + + public void setRatio(Integer ratio) { + this.ratio = ratio; + } + + public String getOtherUnit() { + return otherUnit; + } + + public void setOtherUnit(String otherUnit) { + this.otherUnit = otherUnit; + } + + public BigDecimal getPresetPriceOne() { + return presetPriceOne; + } + + public void setPresetPriceOne(BigDecimal presetPriceOne) { + this.presetPriceOne = presetPriceOne; + } + + public String getPriceStrategy() { + return priceStrategy; + } + + public void setPriceStrategy(String priceStrategy) { + this.priceStrategy = priceStrategy; + } + + public BigDecimal getPurchaseDecimal() { + return purchaseDecimal; + } + + public void setPurchaseDecimal(BigDecimal purchaseDecimal) { + this.purchaseDecimal = purchaseDecimal; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public BigDecimal getWeight() { + return weight; + } + + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + + public String getImgName() { + return imgName; + } + + public void setImgName(String imgName) { + this.imgName = imgName; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/Function.java b/src/main/java/com/wansensoft/erp/datasource/entities/Function.java new file mode 100644 index 00000000..423af2a1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Function.java @@ -0,0 +1,133 @@ +package com.wansensoft.erp.datasource.entities; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number == null ? null : number.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getParentNumber() { + return parentNumber; + } + + public void setParentNumber(String parentNumber) { + this.parentNumber = parentNumber == null ? null : parentNumber.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component == null ? null : component.trim(); + } + + public Boolean getState() { + return state; + } + + public void setState(Boolean state) { + this.state = state; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getPushBtn() { + return pushBtn; + } + + public void setPushBtn(String pushBtn) { + this.pushBtn = pushBtn == null ? null : pushBtn.trim(); + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/FunctionEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/FunctionEx.java new file mode 100644 index 00000000..80731ec8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/FunctionEx.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp.datasource.entities; + +public class FunctionEx extends Function { + + private String parentName; + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/FunctionExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/FunctionExample.java new file mode 100644 index 00000000..d1b7b521 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/FunctionExample.java @@ -0,0 +1,1079 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/InOutItem.java b/src/main/java/com/wansensoft/erp/datasource/entities/InOutItem.java new file mode 100644 index 00000000..09efebb9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/InOutItem.java @@ -0,0 +1,83 @@ +package com.wansensoft.erp.datasource.entities; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/InOutItemExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/InOutItemExample.java new file mode 100644 index 00000000..466b4f64 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/InOutItemExample.java @@ -0,0 +1,729 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Log.java b/src/main/java/com/wansensoft/erp/datasource/entities/Log.java new file mode 100644 index 00000000..554f9273 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Log.java @@ -0,0 +1,85 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation == null ? null : operation.trim(); + } + + public String getClientIp() { + return clientIp; + } + + public void setClientIp(String clientIp) { + this.clientIp = clientIp == null ? null : clientIp.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/LogExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/LogExample.java new file mode 100644 index 00000000..be971bc4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/LogExample.java @@ -0,0 +1,710 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Material.java b/src/main/java/com/wansensoft/erp/datasource/entities/Material.java new file mode 100644 index 00000000..57349df5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Material.java @@ -0,0 +1,225 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCategoryId() { + return categoryId; + } + + public void setCategoryId(Long categoryId) { + this.categoryId = categoryId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getMfrs() { + return mfrs; + } + + public void setMfrs(String mfrs) { + this.mfrs = mfrs == null ? null : mfrs.trim(); + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model == null ? null : model.trim(); + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard == null ? null : standard.trim(); + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color == null ? null : color.trim(); + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit == null ? null : unit.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getImgName() { + return imgName; + } + + public void setImgName(String imgName) { + this.imgName = imgName == null ? null : imgName.trim(); + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Integer getExpiryNum() { + return expiryNum; + } + + public void setExpiryNum(Integer expiryNum) { + this.expiryNum = expiryNum; + } + + public BigDecimal getWeight() { + return weight; + } + + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getOtherField1() { + return otherField1; + } + + public void setOtherField1(String otherField1) { + this.otherField1 = otherField1 == null ? null : otherField1.trim(); + } + + public String getOtherField2() { + return otherField2; + } + + public void setOtherField2(String otherField2) { + this.otherField2 = otherField2 == null ? null : otherField2.trim(); + } + + public String getOtherField3() { + return otherField3; + } + + public void setOtherField3(String otherField3) { + this.otherField3 = otherField3 == null ? null : otherField3.trim(); + } + + public String getEnableSerialNumber() { + return enableSerialNumber; + } + + public void setEnableSerialNumber(String enableSerialNumber) { + this.enableSerialNumber = enableSerialNumber == null ? null : enableSerialNumber.trim(); + } + + public String getEnableBatchNumber() { + return enableBatchNumber; + } + + public void setEnableBatchNumber(String enableBatchNumber) { + this.enableBatchNumber = enableBatchNumber == null ? null : enableBatchNumber.trim(); + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position == null ? null : position.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttribute.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttribute.java new file mode 100644 index 00000000..22249fbb --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttribute.java @@ -0,0 +1,53 @@ +package com.wansensoft.erp.datasource.entities; + +public class MaterialAttribute { + private Long id; + + private String attributeName; + + private String attributeValue; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAttributeName() { + return attributeName; + } + + public void setAttributeName(String attributeName) { + this.attributeName = attributeName == null ? null : attributeName.trim(); + } + + public String getAttributeValue() { + return attributeValue; + } + + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue == null ? null : attributeValue.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttributeExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttributeExample.java new file mode 100644 index 00000000..25f3ca09 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialAttributeExample.java @@ -0,0 +1,529 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategory.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategory.java new file mode 100644 index 00000000..b27f0820 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategory.java @@ -0,0 +1,115 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Short getCategoryLevel() { + return categoryLevel; + } + + public void setCategoryLevel(Short categoryLevel) { + this.categoryLevel = categoryLevel; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo == null ? null : serialNo.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategoryExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategoryExample.java new file mode 100644 index 00000000..7a900351 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCategoryExample.java @@ -0,0 +1,910 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStock.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStock.java new file mode 100644 index 00000000..51b649f0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStock.java @@ -0,0 +1,65 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +public class MaterialCurrentStock { + private Long id; + + private Long materialId; + + private Long depotId; + + private BigDecimal currentNumber; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public BigDecimal getCurrentNumber() { + return currentNumber; + } + + public void setCurrentNumber(BigDecimal currentNumber) { + this.currentNumber = currentNumber; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStockExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStockExample.java new file mode 100644 index 00000000..f69559e8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialCurrentStockExample.java @@ -0,0 +1,570 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExample.java new file mode 100644 index 00000000..8532a070 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExample.java @@ -0,0 +1,1670 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtend.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtend.java new file mode 100644 index 00000000..93309e60 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtend.java @@ -0,0 +1,166 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode == null ? null : barCode.trim(); + } + + public String getCommodityUnit() { + return commodityUnit; + } + + public void setCommodityUnit(String commodityUnit) { + this.commodityUnit = commodityUnit == null ? null : commodityUnit.trim(); + } + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku == null ? null : sku.trim(); + } + + public BigDecimal getPurchaseDecimal() { + return purchaseDecimal; + } + + public void setPurchaseDecimal(BigDecimal purchaseDecimal) { + this.purchaseDecimal = purchaseDecimal; + } + + public BigDecimal getCommodityDecimal() { + return commodityDecimal; + } + + public void setCommodityDecimal(BigDecimal commodityDecimal) { + this.commodityDecimal = commodityDecimal; + } + + public BigDecimal getWholesaleDecimal() { + return wholesaleDecimal; + } + + public void setWholesaleDecimal(BigDecimal wholesaleDecimal) { + this.wholesaleDecimal = wholesaleDecimal; + } + + public BigDecimal getLowDecimal() { + return lowDecimal; + } + + public void setLowDecimal(BigDecimal lowDecimal) { + this.lowDecimal = lowDecimal; + } + + public String getDefaultFlag() { + return defaultFlag; + } + + public void setDefaultFlag(String defaultFlag) { + this.defaultFlag = defaultFlag == null ? null : defaultFlag.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getCreateSerial() { + return createSerial; + } + + public void setCreateSerial(String createSerial) { + this.createSerial = createSerial == null ? null : createSerial.trim(); + } + + public String getUpdateSerial() { + return updateSerial; + } + + public void setUpdateSerial(String updateSerial) { + this.updateSerial = updateSerial == null ? null : updateSerial.trim(); + } + + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Long updateTime) { + this.updateTime = updateTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtendExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtendExample.java new file mode 100644 index 00000000..c0aa95f6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialExtendExample.java @@ -0,0 +1,1231 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStock.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStock.java new file mode 100644 index 00000000..14975b54 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStock.java @@ -0,0 +1,85 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public BigDecimal getLowSafeStock() { + return lowSafeStock; + } + + public void setLowSafeStock(BigDecimal lowSafeStock) { + this.lowSafeStock = lowSafeStock; + } + + public BigDecimal getHighSafeStock() { + return highSafeStock; + } + + public void setHighSafeStock(BigDecimal highSafeStock) { + this.highSafeStock = highSafeStock; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockExample.java new file mode 100644 index 00000000..d98856fb --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockExample.java @@ -0,0 +1,690 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockWithMaterial.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockWithMaterial.java new file mode 100644 index 00000000..312799f7 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialInitialStockWithMaterial.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +public class MaterialInitialStockWithMaterial { + + private Long materialId; + + private BigDecimal number; + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialProperty.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialProperty.java new file mode 100644 index 00000000..789b263e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialProperty.java @@ -0,0 +1,63 @@ +package com.wansensoft.erp.datasource.entities; + +public class MaterialProperty { + private Long id; + + private String nativeName; + + private Boolean enabled; + + private String sort; + + private String anotherName; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNativeName() { + return nativeName; + } + + public void setNativeName(String nativeName) { + this.nativeName = nativeName == null ? null : nativeName.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getAnotherName() { + return anotherName; + } + + public void setAnotherName(String anotherName) { + this.anotherName = anotherName == null ? null : anotherName.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialPropertyExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialPropertyExample.java new file mode 100644 index 00000000..d91ac84e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialPropertyExample.java @@ -0,0 +1,599 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/MaterialVo4Unit.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialVo4Unit.java new file mode 100644 index 00000000..8021c24d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialVo4Unit.java @@ -0,0 +1,229 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public BigDecimal getRatio() { + return ratio; + } + + public void setRatio(BigDecimal ratio) { + this.ratio = ratio; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getMaterialOther() { + return materialOther; + } + + public void setMaterialOther(String materialOther) { + this.materialOther = materialOther; + } + + public BigDecimal getStock() { + return stock; + } + + public void setStock(BigDecimal stock) { + this.stock = stock; + } + + public BigDecimal getPurchaseDecimal() { + return purchaseDecimal; + } + + public void setPurchaseDecimal(BigDecimal purchaseDecimal) { + this.purchaseDecimal = purchaseDecimal; + } + + public BigDecimal getCommodityDecimal() { + return commodityDecimal; + } + + public void setCommodityDecimal(BigDecimal commodityDecimal) { + this.commodityDecimal = commodityDecimal; + } + + public BigDecimal getWholesaleDecimal() { + return wholesaleDecimal; + } + + public void setWholesaleDecimal(BigDecimal wholesaleDecimal) { + this.wholesaleDecimal = wholesaleDecimal; + } + + public BigDecimal getLowDecimal() { + return lowDecimal; + } + + public void setLowDecimal(BigDecimal lowDecimal) { + this.lowDecimal = lowDecimal; + } + + public BigDecimal getBillPrice() { + return billPrice; + } + + public void setBillPrice(BigDecimal billPrice) { + this.billPrice = billPrice; + } + + public String getmBarCode() { + return mBarCode; + } + + public void setmBarCode(String mBarCode) { + this.mBarCode = mBarCode; + } + + public String getCommodityUnit() { + return commodityUnit; + } + + public void setCommodityUnit(String commodityUnit) { + this.commodityUnit = commodityUnit; + } + + public Long getMeId() { + return meId; + } + + public void setMeId(Long meId) { + this.meId = meId; + } + + public BigDecimal getInitialStock() { + return initialStock; + } + + public void setInitialStock(BigDecimal initialStock) { + this.initialStock = initialStock; + } + + public BigDecimal getCurrentStock() { + return currentStock; + } + + public void setCurrentStock(BigDecimal currentStock) { + this.currentStock = currentStock; + } + + public BigDecimal getCurrentStockPrice() { + return currentStockPrice; + } + + public void setCurrentStockPrice(BigDecimal currentStockPrice) { + this.currentStockPrice = currentStockPrice; + } + + public BigDecimal getCurrentWeight() { + return currentWeight; + } + + public void setCurrentWeight(BigDecimal currentWeight) { + this.currentWeight = currentWeight; + } + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku; + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public String getBigUnitStock() { + return bigUnitStock; + } + + public void setBigUnitStock(String bigUnitStock) { + this.bigUnitStock = bigUnitStock; + } + + public String getImgSmall() { + return imgSmall; + } + + public void setImgSmall(String imgSmall) { + this.imgSmall = imgSmall; + } + + public String getImgLarge() { + return imgLarge; + } + + public void setImgLarge(String imgLarge) { + this.imgLarge = imgLarge; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MaterialWithInitStock.java b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialWithInitStock.java new file mode 100644 index 00000000..cc1e77fb --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MaterialWithInitStock.java @@ -0,0 +1,29 @@ +package com.wansensoft.erp.datasource.entities; + +import com.alibaba.fastjson.JSONObject; + +import java.math.BigDecimal; +import java.util.Map; + +public class MaterialWithInitStock extends Material { + + private Map stockMap; + + private JSONObject materialExObj; + + public Map getStockMap() { + return stockMap; + } + + public void setStockMap(Map stockMap) { + this.stockMap = stockMap; + } + + public JSONObject getMaterialExObj() { + return materialExObj; + } + + public void setMaterialExObj(JSONObject materialExObj) { + this.materialExObj = materialExObj; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/Msg.java b/src/main/java/com/wansensoft/erp/datasource/entities/Msg.java new file mode 100644 index 00000000..cfde8d2b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Msg.java @@ -0,0 +1,95 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMsgTitle() { + return msgTitle; + } + + public void setMsgTitle(String msgTitle) { + this.msgTitle = msgTitle == null ? null : msgTitle.trim(); + } + + public String getMsgContent() { + return msgContent; + } + + public void setMsgContent(String msgContent) { + this.msgContent = msgContent == null ? null : msgContent.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MsgEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/MsgEx.java new file mode 100644 index 00000000..c3f02290 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MsgEx.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp.datasource.entities; + +public class MsgEx extends Msg{ + + private String createTimeStr; + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/MsgExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/MsgExample.java new file mode 100644 index 00000000..76206b63 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/MsgExample.java @@ -0,0 +1,790 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRel.java b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRel.java new file mode 100644 index 00000000..54e90fb2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRel.java @@ -0,0 +1,325 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.id + * + * @return the value of jsh_orga_user_rel.id + * + * @mbggenerated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.id + * + * @param id the value for jsh_orga_user_rel.id + * + * @mbggenerated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.orga_id + * + * @return the value of jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + public Long getOrgaId() { + return orgaId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.orga_id + * + * @param orgaId the value for jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + public void setOrgaId(Long orgaId) { + this.orgaId = orgaId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.user_id + * + * @return the value of jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + public Long getUserId() { + return userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.user_id + * + * @param userId the value for jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + public void setUserId(Long userId) { + this.userId = userId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @return the value of jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + public String getUserBlngOrgaDsplSeq() { + return userBlngOrgaDsplSeq; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @param userBlngOrgaDsplSeq the value for jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + public void setUserBlngOrgaDsplSeq(String userBlngOrgaDsplSeq) { + this.userBlngOrgaDsplSeq = userBlngOrgaDsplSeq == null ? null : userBlngOrgaDsplSeq.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.delete_flag + * + * @return the value of jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + public String getDeleteFlag() { + return deleteFlag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.delete_flag + * + * @param deleteFlag the value for jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.create_time + * + * @return the value of jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + public Date getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.create_time + * + * @param createTime the value for jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.creator + * + * @return the value of jsh_orga_user_rel.creator + * + * @mbggenerated + */ + public Long getCreator() { + return creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.creator + * + * @param creator the value for jsh_orga_user_rel.creator + * + * @mbggenerated + */ + public void setCreator(Long creator) { + this.creator = creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.update_time + * + * @return the value of jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + public Date getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.update_time + * + * @param updateTime the value for jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.updater + * + * @return the value of jsh_orga_user_rel.updater + * + * @mbggenerated + */ + public Long getUpdater() { + return updater; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.updater + * + * @param updater the value for jsh_orga_user_rel.updater + * + * @mbggenerated + */ + public void setUpdater(Long updater) { + this.updater = updater; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_orga_user_rel.tenant_id + * + * @return the value of jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + public Long getTenantId() { + return tenantId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_orga_user_rel.tenant_id + * + * @param tenantId the value for jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelEx.java new file mode 100644 index 00000000..d9366a6b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelEx.java @@ -0,0 +1,10 @@ +package com.wansensoft.erp.datasource.entities; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/12 10:09 + */ +public class OrgaUserRelEx extends OrgaUserRel { +} diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelExample.java new file mode 100644 index 00000000..0f9cf194 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/OrgaUserRelExample.java @@ -0,0 +1,923 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Organization.java b/src/main/java/com/wansensoft/erp/datasource/entities/Organization.java new file mode 100644 index 00000000..137c61ac --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Organization.java @@ -0,0 +1,105 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrgNo() { + return orgNo; + } + + public void setOrgNo(String orgNo) { + this.orgNo = orgNo == null ? null : orgNo.trim(); + } + + public String getOrgAbr() { + return orgAbr; + } + + public void setOrgAbr(String orgAbr) { + this.orgAbr = orgAbr == null ? null : orgAbr.trim(); + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/OrganizationExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/OrganizationExample.java new file mode 100644 index 00000000..f7990890 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/OrganizationExample.java @@ -0,0 +1,850 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Person.java b/src/main/java/com/wansensoft/erp/datasource/entities/Person.java new file mode 100644 index 00000000..7965980a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Person.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.datasource.entities; + +public class Person { + private Long id; + + private String type; + + private String name; + + private Boolean enabled; + + private String sort; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/PersonExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/PersonExample.java new file mode 100644 index 00000000..e65c3d0b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/PersonExample.java @@ -0,0 +1,659 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfig.java b/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfig.java new file mode 100644 index 00000000..dc4210dc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfig.java @@ -0,0 +1,43 @@ +package com.wansensoft.erp.datasource.entities; + +public class PlatformConfig { + private Long id; + + private String platformKey; + + private String platformKeyInfo; + + private String platformValue; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPlatformKey() { + return platformKey; + } + + public void setPlatformKey(String platformKey) { + this.platformKey = platformKey == null ? null : platformKey.trim(); + } + + public String getPlatformKeyInfo() { + return platformKeyInfo; + } + + public void setPlatformKeyInfo(String platformKeyInfo) { + this.platformKeyInfo = platformKeyInfo == null ? null : platformKeyInfo.trim(); + } + + public String getPlatformValue() { + return platformValue; + } + + public void setPlatformValue(String platformValue) { + this.platformValue = platformValue == null ? null : platformValue.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfigExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfigExample.java new file mode 100644 index 00000000..8b605d02 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/PlatformConfigExample.java @@ -0,0 +1,469 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Role.java b/src/main/java/com/wansensoft/erp/datasource/entities/Role.java new file mode 100644 index 00000000..61da3a06 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Role.java @@ -0,0 +1,103 @@ +package com.wansensoft.erp.datasource.entities; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getPriceLimit() { + return priceLimit; + } + + public void setPriceLimit(String priceLimit) { + this.priceLimit = priceLimit == null ? null : priceLimit.trim(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/RoleEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/RoleEx.java new file mode 100644 index 00000000..c7946bfd --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/RoleEx.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp.datasource.entities; + +public class RoleEx extends Role{ + + private String priceLimitStr; + + public String getPriceLimitStr() { + return priceLimitStr; + } + + public void setPriceLimitStr(String priceLimitStr) { + this.priceLimitStr = priceLimitStr; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/RoleExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/RoleExample.java new file mode 100644 index 00000000..8b3bde87 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/RoleExample.java @@ -0,0 +1,869 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumber.java b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumber.java new file mode 100644 index 00000000..23111bc0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumber.java @@ -0,0 +1,145 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getDepotId() { + return depotId; + } + + public void setDepotId(Long depotId) { + this.depotId = depotId; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber == null ? null : serialNumber.trim(); + } + + public String getIsSell() { + return isSell; + } + + public void setIsSell(String isSell) { + this.isSell = isSell == null ? null : isSell.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdater() { + return updater; + } + + public void setUpdater(Long updater) { + this.updater = updater; + } + + public String getInBillNo() { + return inBillNo; + } + + public void setInBillNo(String inBillNo) { + this.inBillNo = inBillNo == null ? null : inBillNo.trim(); + } + + public String getOutBillNo() { + return outBillNo; + } + + public void setOutBillNo(String outBillNo) { + this.outBillNo = outBillNo == null ? null : outBillNo.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberEx.java new file mode 100644 index 00000000..4d70767f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberEx.java @@ -0,0 +1,108 @@ +package com.wansensoft.erp.datasource.entities; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 17:32 + */ +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; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getUpdaterName() { + return updaterName; + } + + public void setUpdaterName(String updaterName) { + this.updaterName = updaterName; + } + + public String getDepotHeadNumber() { + return depotHeadNumber; + } + + public void setDepotHeadNumber(String depotHeadNumber) { + this.depotHeadNumber = depotHeadNumber; + } + + public String getDepotHeadType() { + return depotHeadType; + } + + public void setDepotHeadType(String depotHeadType) { + this.depotHeadType = depotHeadType; + } + + public String getDepotName() { + return depotName; + } + + public void setDepotName(String depotName) { + this.depotName = depotName; + } + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } + + public String getUpdateTimeStr() { + return updateTimeStr; + } + + public void setUpdateTimeStr(String updateTimeStr) { + this.updateTimeStr = updateTimeStr; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberExample.java new file mode 100644 index 00000000..87a59c63 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SerialNumberExample.java @@ -0,0 +1,1100 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Supplier.java b/src/main/java/com/wansensoft/erp/datasource/entities/Supplier.java new file mode 100644 index 00000000..e5a45e3a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Supplier.java @@ -0,0 +1,255 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier == null ? null : supplier.trim(); + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts == null ? null : contacts.trim(); + } + + public String getPhoneNum() { + return phoneNum; + } + + public void setPhoneNum(String phoneNum) { + this.phoneNum = phoneNum == null ? null : phoneNum.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public Byte getIsystem() { + return isystem; + } + + public void setIsystem(Byte isystem) { + this.isystem = isystem; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public BigDecimal getAdvanceIn() { + return advanceIn; + } + + public void setAdvanceIn(BigDecimal advanceIn) { + this.advanceIn = advanceIn; + } + + public BigDecimal getBeginNeedGet() { + return beginNeedGet; + } + + public void setBeginNeedGet(BigDecimal beginNeedGet) { + this.beginNeedGet = beginNeedGet; + } + + public BigDecimal getBeginNeedPay() { + return beginNeedPay; + } + + public void setBeginNeedPay(BigDecimal beginNeedPay) { + this.beginNeedPay = beginNeedPay; + } + + public BigDecimal getAllNeedGet() { + return allNeedGet; + } + + public void setAllNeedGet(BigDecimal allNeedGet) { + this.allNeedGet = allNeedGet; + } + + public BigDecimal getAllNeedPay() { + return allNeedPay; + } + + public void setAllNeedPay(BigDecimal allNeedPay) { + this.allNeedPay = allNeedPay; + } + + public String getFax() { + return fax; + } + + public void setFax(String fax) { + this.fax = fax == null ? null : fax.trim(); + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getTaxNum() { + return taxNum; + } + + public void setTaxNum(String taxNum) { + this.taxNum = taxNum == null ? null : taxNum.trim(); + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName == null ? null : bankName.trim(); + } + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber == null ? null : accountNumber.trim(); + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + public Long getCreator() { + return creator; + } + + public void setCreator(Long creator) { + this.creator = creator; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/SupplierExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/SupplierExample.java new file mode 100644 index 00000000..4740bc6e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SupplierExample.java @@ -0,0 +1,1840 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/SysLoginModel.java b/src/main/java/com/wansensoft/erp/datasource/entities/SysLoginModel.java new file mode 100644 index 00000000..763f56bc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SysLoginModel.java @@ -0,0 +1,55 @@ +package com.wansensoft.erp.datasource.entities; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 登录表单 + * + * @Author scott + * @since 2019-01-18 + */ +@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; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getCaptcha() { + return captcha; + } + + public void setCaptcha(String captcha) { + this.captcha = captcha; + } + + public String getCheckKey() { + return checkKey; + } + + public void setCheckKey(String checkKey) { + this.checkKey = checkKey; + } + +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfig.java b/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfig.java new file mode 100644 index 00000000..8ac7f089 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfig.java @@ -0,0 +1,193 @@ +package com.wansensoft.erp.datasource.entities; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName == null ? null : companyName.trim(); + } + + public String getCompanyContacts() { + return companyContacts; + } + + public void setCompanyContacts(String companyContacts) { + this.companyContacts = companyContacts == null ? null : companyContacts.trim(); + } + + public String getCompanyAddress() { + return companyAddress; + } + + public void setCompanyAddress(String companyAddress) { + this.companyAddress = companyAddress == null ? null : companyAddress.trim(); + } + + public String getCompanyTel() { + return companyTel; + } + + public void setCompanyTel(String companyTel) { + this.companyTel = companyTel == null ? null : companyTel.trim(); + } + + public String getCompanyFax() { + return companyFax; + } + + public void setCompanyFax(String companyFax) { + this.companyFax = companyFax == null ? null : companyFax.trim(); + } + + public String getCompanyPostCode() { + return companyPostCode; + } + + public void setCompanyPostCode(String companyPostCode) { + this.companyPostCode = companyPostCode == null ? null : companyPostCode.trim(); + } + + public String getSaleAgreement() { + return saleAgreement; + } + + public void setSaleAgreement(String saleAgreement) { + this.saleAgreement = saleAgreement == null ? null : saleAgreement.trim(); + } + + public String getDepotFlag() { + return depotFlag; + } + + public void setDepotFlag(String depotFlag) { + this.depotFlag = depotFlag == null ? null : depotFlag.trim(); + } + + public String getCustomerFlag() { + return customerFlag; + } + + public void setCustomerFlag(String customerFlag) { + this.customerFlag = customerFlag == null ? null : customerFlag.trim(); + } + + public String getMinusStockFlag() { + return minusStockFlag; + } + + public void setMinusStockFlag(String minusStockFlag) { + this.minusStockFlag = minusStockFlag == null ? null : minusStockFlag.trim(); + } + + public String getPurchaseBySaleFlag() { + return purchaseBySaleFlag; + } + + public void setPurchaseBySaleFlag(String purchaseBySaleFlag) { + this.purchaseBySaleFlag = purchaseBySaleFlag == null ? null : purchaseBySaleFlag.trim(); + } + + public String getMultiLevelApprovalFlag() { + return multiLevelApprovalFlag; + } + + public void setMultiLevelApprovalFlag(String multiLevelApprovalFlag) { + this.multiLevelApprovalFlag = multiLevelApprovalFlag == null ? null : multiLevelApprovalFlag.trim(); + } + + public String getMultiBillType() { + return multiBillType; + } + + public void setMultiBillType(String multiBillType) { + this.multiBillType = multiBillType == null ? null : multiBillType.trim(); + } + + public String getForceApprovalFlag() { + return forceApprovalFlag; + } + + public void setForceApprovalFlag(String forceApprovalFlag) { + this.forceApprovalFlag = forceApprovalFlag == null ? null : forceApprovalFlag.trim(); + } + + public String getUpdateUnitPriceFlag() { + return updateUnitPriceFlag; + } + + public void setUpdateUnitPriceFlag(String updateUnitPriceFlag) { + this.updateUnitPriceFlag = updateUnitPriceFlag == null ? null : updateUnitPriceFlag.trim(); + } + + public String getOverLinkBillFlag() { + return overLinkBillFlag; + } + + public void setOverLinkBillFlag(String overLinkBillFlag) { + this.overLinkBillFlag = overLinkBillFlag == null ? null : overLinkBillFlag.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfigExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfigExample.java new file mode 100644 index 00000000..3d1fd23b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/SystemConfigExample.java @@ -0,0 +1,1509 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/Tenant.java b/src/main/java/com/wansensoft/erp/datasource/entities/Tenant.java new file mode 100644 index 00000000..8c4b3d5e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Tenant.java @@ -0,0 +1,95 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.Date; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName == null ? null : loginName.trim(); + } + + public Integer getUserNumLimit() { + return userNumLimit; + } + + public void setUserNumLimit(Integer userNumLimit) { + this.userNumLimit = userNumLimit; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getExpireTime() { + return expireTime; + } + + public void setExpireTime(Date expireTime) { + this.expireTime = expireTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/TenantEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/TenantEx.java new file mode 100644 index 00000000..ab0e4367 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/TenantEx.java @@ -0,0 +1,34 @@ +package com.wansensoft.erp.datasource.entities; + +public class TenantEx extends Tenant{ + + private String createTimeStr; + + private String expireTimeStr; + + private Integer userCount; + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } + + public String getExpireTimeStr() { + return expireTimeStr; + } + + public void setExpireTimeStr(String expireTimeStr) { + this.expireTimeStr = expireTimeStr; + } + + public Integer getUserCount() { + return userCount; + } + + public void setUserCount(Integer userCount) { + this.userCount = userCount; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/TenantExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/TenantExample.java new file mode 100644 index 00000000..1152b5af --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/TenantExample.java @@ -0,0 +1,770 @@ +package com.wansensoft.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +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 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 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/src/main/java/com/wansensoft/erp/datasource/entities/Unit.java b/src/main/java/com/wansensoft/erp/datasource/entities/Unit.java new file mode 100644 index 00000000..f7c99a8e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/Unit.java @@ -0,0 +1,125 @@ +package com.wansensoft.erp.datasource.entities; + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getBasicUnit() { + return basicUnit; + } + + public void setBasicUnit(String basicUnit) { + this.basicUnit = basicUnit == null ? null : basicUnit.trim(); + } + + public String getOtherUnit() { + return otherUnit; + } + + public void setOtherUnit(String otherUnit) { + this.otherUnit = otherUnit == null ? null : otherUnit.trim(); + } + + public String getOtherUnitTwo() { + return otherUnitTwo; + } + + public void setOtherUnitTwo(String otherUnitTwo) { + this.otherUnitTwo = otherUnitTwo == null ? null : otherUnitTwo.trim(); + } + + public String getOtherUnitThree() { + return otherUnitThree; + } + + public void setOtherUnitThree(String otherUnitThree) { + this.otherUnitThree = otherUnitThree == null ? null : otherUnitThree.trim(); + } + + public BigDecimal getRatio() { + return ratio; + } + + public void setRatio(BigDecimal ratio) { + this.ratio = ratio; + } + + public BigDecimal getRatioTwo() { + return ratioTwo; + } + + public void setRatioTwo(BigDecimal ratioTwo) { + this.ratioTwo = ratioTwo; + } + + public BigDecimal getRatioThree() { + return ratioThree; + } + + public void setRatioThree(BigDecimal ratioThree) { + this.ratioThree = ratioThree; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/UnitExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/UnitExample.java new file mode 100644 index 00000000..2ac5ede9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/UnitExample.java @@ -0,0 +1,980 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/User.java b/src/main/java/com/wansensoft/erp/datasource/entities/User.java new file mode 100644 index 00000000..8b0e41b3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/User.java @@ -0,0 +1,163 @@ +package com.wansensoft.erp.datasource.entities; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName == null ? null : loginName.trim(); + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password == null ? null : password.trim(); + } + + public String getLeaderFlag() { + return leaderFlag; + } + + public void setLeaderFlag(String leaderFlag) { + this.leaderFlag = leaderFlag == null ? null : leaderFlag.trim(); + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position == null ? null : position.trim(); + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department == null ? null : department.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public String getPhonenum() { + return phonenum; + } + + public void setPhonenum(String phonenum) { + this.phonenum = phonenum == null ? null : phonenum.trim(); + } + + public Byte getIsmanager() { + return ismanager; + } + + public void setIsmanager(Byte ismanager) { + this.ismanager = ismanager; + } + + public Byte getIsystem() { + return isystem; + } + + public void setIsystem(Byte isystem) { + this.isystem = isystem; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getWeixinOpenId() { + return weixinOpenId; + } + + public void setWeixinOpenId(String weixinOpenId) { + this.weixinOpenId = weixinOpenId == null ? null : weixinOpenId.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/UserBusiness.java b/src/main/java/com/wansensoft/erp/datasource/entities/UserBusiness.java new file mode 100644 index 00000000..3671e2d4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/UserBusiness.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.datasource.entities; + +public class UserBusiness { + private Long id; + + private String type; + + private String keyId; + + private String value; + + private String btnStr; + + private Long tenantId; + + private String deleteFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getKeyId() { + return keyId; + } + + public void setKeyId(String keyId) { + this.keyId = keyId == null ? null : keyId.trim(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + public String getBtnStr() { + return btnStr; + } + + public void setBtnStr(String btnStr) { + this.btnStr = btnStr == null ? null : btnStr.trim(); + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } + + public String getDeleteFlag() { + return deleteFlag; + } + + public void setDeleteFlag(String deleteFlag) { + this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/UserBusinessExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/UserBusinessExample.java new file mode 100644 index 00000000..5f67fa97 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/UserBusinessExample.java @@ -0,0 +1,669 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/entities/UserEx.java b/src/main/java/com/wansensoft/erp/datasource/entities/UserEx.java new file mode 100644 index 00000000..b744dba2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/UserEx.java @@ -0,0 +1,110 @@ +package com.wansensoft.erp.datasource.entities; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/8 15:12 + */ +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; + + public String getOrgAbr() { + return orgAbr; + } + + public void setOrgAbr(String orgAbr) { + this.orgAbr = orgAbr; + } + + public Long getOrgaId() { + return orgaId; + } + + public void setOrgaId(Long orgaId) { + this.orgaId = orgaId; + } + + public String getUserBlngOrgaDsplSeq() { + return userBlngOrgaDsplSeq; + } + + public void setUserBlngOrgaDsplSeq(String userBlngOrgaDsplSeq) { + this.userBlngOrgaDsplSeq = userBlngOrgaDsplSeq; + } + + public Long getOrgaUserRelId() { + return orgaUserRelId; + } + + public void setOrgaUserRelId(Long orgaUserRelId) { + this.orgaUserRelId = orgaUserRelId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public Integer getUserNumLimit() { + return userNumLimit; + } + + public void setUserNumLimit(Integer userNumLimit) { + this.userNumLimit = userNumLimit; + } + + public String getExpireTime() { + return expireTime; + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + public String getLeaderFlagStr() { + return leaderFlagStr; + } + + public void setLeaderFlagStr(String leaderFlagStr) { + this.leaderFlagStr = leaderFlagStr; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/entities/UserExample.java b/src/main/java/com/wansensoft/erp/datasource/entities/UserExample.java new file mode 100644 index 00000000..819cadb6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/entities/UserExample.java @@ -0,0 +1,1269 @@ +package com.wansensoft.erp.datasource.entities; + +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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapper.java new file mode 100644 index 00000000..1b551ac2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapper.java @@ -0,0 +1,33 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.AccountHead; +import com.wansensoft.erp.datasource.entities.AccountHeadExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface AccountHeadMapper { + long countByExample(AccountHeadExample example); + + int deleteByExample(AccountHeadExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapperEx.java new file mode 100644 index 00000000..f6c01f43 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountHeadMapperEx.java @@ -0,0 +1,61 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.AccountHead; +import com.wansensoft.erp.datasource.entities.AccountHeadVo4ListEx; +import com.wansensoft.erp.datasource.entities.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 { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapper.java new file mode 100644 index 00000000..c6481ad2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapper.java @@ -0,0 +1,33 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.AccountItem; +import com.wansensoft.erp.datasource.entities.AccountItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface AccountItemMapper { + long countByExample(AccountItemExample example); + + int deleteByExample(AccountItemExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapperEx.java new file mode 100644 index 00000000..25891ef6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountItemMapperEx.java @@ -0,0 +1,43 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.AccountItem; +import com.wansensoft.erp.datasource.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 { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapper.java new file mode 100644 index 00000000..7b524ea7 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapper.java @@ -0,0 +1,33 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Account; +import com.wansensoft.erp.datasource.entities.AccountExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface AccountMapper { + long countByExample(AccountExample example); + + int deleteByExample(AccountExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapperEx.java new file mode 100644 index 00000000..a375e0b0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/AccountMapperEx.java @@ -0,0 +1,41 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Account; +import com.wansensoft.erp.datasource.vo.AccountVo4InOutList; +import com.wansensoft.erp.datasource.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 { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapper.java new file mode 100644 index 00000000..9fde4e62 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.DepotHead; +import com.wansensoft.erp.datasource.entities.DepotHeadExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface DepotHeadMapper { + long countByExample(DepotHeadExample example); + + int deleteByExample(DepotHeadExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapperEx.java new file mode 100644 index 00000000..4d274a31 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotHeadMapperEx.java @@ -0,0 +1,246 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.DepotHead; +import com.wansensoft.erp.datasource.vo.*; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/25 14:50 + */ +public interface DepotHeadMapperEx { + 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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapper.java new file mode 100644 index 00000000..049712c5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.DepotItem; +import com.wansensoft.erp.datasource.entities.DepotItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface DepotItemMapper { + long countByExample(DepotItemExample example); + + int deleteByExample(DepotItemExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapperEx.java new file mode 100644 index 00000000..a9fc747e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotItemMapperEx.java @@ -0,0 +1,242 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.vo.DepotItemStockWarningCount; +import com.wansensoft.erp.datasource.vo.DepotItemVo4Stock; +import com.wansensoft.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.wansensoft.erp.datasource.entities.*; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/24 16:59 + */ +public interface DepotItemMapperEx { + 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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapper.java new file mode 100644 index 00000000..b29b1f2a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Depot; +import com.wansensoft.erp.datasource.entities.DepotExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface DepotMapper { + long countByExample(DepotExample example); + + int deleteByExample(DepotExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapperEx.java new file mode 100644 index 00000000..5672be52 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/DepotMapperEx.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.DepotEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface DepotMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapper.java new file mode 100644 index 00000000..b2c0fc06 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Function; +import com.wansensoft.erp.datasource.entities.FunctionExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface FunctionMapper { + long countByExample(FunctionExample example); + + int deleteByExample(FunctionExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapperEx.java new file mode 100644 index 00000000..87e08418 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/FunctionMapperEx.java @@ -0,0 +1,22 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.FunctionEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface FunctionMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapper.java new file mode 100644 index 00000000..26ff8eb1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.InOutItem; +import com.wansensoft.erp.datasource.entities.InOutItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface InOutItemMapper { + long countByExample(InOutItemExample example); + + int deleteByExample(InOutItemExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapperEx.java new file mode 100644 index 00000000..d3eefa20 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/InOutItemMapperEx.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.InOutItem; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface InOutItemMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapper.java new file mode 100644 index 00000000..104729ab --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Log; +import com.wansensoft.erp.datasource.entities.LogExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface LogMapper { + long countByExample(LogExample example); + + int deleteByExample(LogExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapperEx.java new file mode 100644 index 00000000..ce38c69f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/LogMapperEx.java @@ -0,0 +1,38 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Log; +import com.wansensoft.erp.datasource.vo.LogVo4List; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface LogMapperEx { + + 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); + + int insertLogWithUserId(Log log); +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapper.java new file mode 100644 index 00000000..5048cb55 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialAttribute; +import com.wansensoft.erp.datasource.entities.MaterialAttributeExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialAttributeMapper { + long countByExample(MaterialAttributeExample example); + + int deleteByExample(MaterialAttributeExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapperEx.java new file mode 100644 index 00000000..ee4b5a3f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialAttributeMapperEx.java @@ -0,0 +1,20 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialAttribute; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MaterialAttributeMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapper.java new file mode 100644 index 00000000..c2170c17 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialCategory; +import com.wansensoft.erp.datasource.entities.MaterialCategoryExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialCategoryMapper { + long countByExample(MaterialCategoryExample example); + + int deleteByExample(MaterialCategoryExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapperEx.java new file mode 100644 index 00000000..bded1db6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCategoryMapperEx.java @@ -0,0 +1,42 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialCategory; +import com.wansensoft.erp.datasource.vo.TreeNode; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/2/18 17:23 + */ +public interface MaterialCategoryMapperEx { + 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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapper.java new file mode 100644 index 00000000..94ab2567 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialCurrentStock; +import com.wansensoft.erp.datasource.entities.MaterialCurrentStockExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialCurrentStockMapper { + long countByExample(MaterialCurrentStockExample example); + + int deleteByExample(MaterialCurrentStockExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapperEx.java new file mode 100644 index 00000000..aa48c029 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialCurrentStockMapperEx.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialCurrentStock; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MaterialCurrentStockMapperEx { + + int batchInsert(List list); + + List getCurrentStockMapByIdList( + @Param("materialIdList") List materialIdList); +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapper.java new file mode 100644 index 00000000..05a0d3da --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialExtend; +import com.wansensoft.erp.datasource.entities.MaterialExtendExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialExtendMapper { + long countByExample(MaterialExtendExample example); + + int deleteByExample(MaterialExtendExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapperEx.java new file mode 100644 index 00000000..e85dd623 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialExtendMapperEx.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialExtend; +import com.wansensoft.erp.datasource.vo.MaterialExtendVo4List; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MaterialExtendMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapper.java new file mode 100644 index 00000000..d8eca7bc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialInitialStock; +import com.wansensoft.erp.datasource.entities.MaterialInitialStockExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialInitialStockMapper { + long countByExample(MaterialInitialStockExample example); + + int deleteByExample(MaterialInitialStockExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapperEx.java new file mode 100644 index 00000000..a2949940 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialInitialStockMapperEx.java @@ -0,0 +1,13 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialInitialStock; + +import java.util.List; + +public interface MaterialInitialStockMapperEx { + + int batchInsert(List list); + + List getListExceptZero(); + +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapper.java new file mode 100644 index 00000000..65e3d0f0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Material; +import com.wansensoft.erp.datasource.entities.MaterialExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialMapper { + long countByExample(MaterialExample example); + + int deleteByExample(MaterialExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapperEx.java new file mode 100644 index 00000000..cd4ea8d8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialMapperEx.java @@ -0,0 +1,162 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.vo.MaterialVoSearch; +import com.wansensoft.erp.datasource.entities.*; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/22 14:54 + */ +public interface MaterialMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapper.java new file mode 100644 index 00000000..b32cd816 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialProperty; +import com.wansensoft.erp.datasource.entities.MaterialPropertyExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MaterialPropertyMapper { + long countByExample(MaterialPropertyExample example); + + int deleteByExample(MaterialPropertyExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapperEx.java new file mode 100644 index 00000000..8891a04a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MaterialPropertyMapperEx.java @@ -0,0 +1,19 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MaterialProperty; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface MaterialPropertyMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapper.java new file mode 100644 index 00000000..81cc88c2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Msg; +import com.wansensoft.erp.datasource.entities.MsgExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface MsgMapper { + long countByExample(MsgExample example); + + int deleteByExample(MsgExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapperEx.java new file mode 100644 index 00000000..9aa32cee --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/MsgMapperEx.java @@ -0,0 +1,25 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.MsgEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MsgMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapper.java new file mode 100644 index 00000000..d028e616 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapper.java @@ -0,0 +1,97 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.OrgaUserRel; +import com.wansensoft.erp.datasource.entities.OrgaUserRelExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface OrgaUserRelMapper { + /** + * 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 insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapperEx.java new file mode 100644 index 00000000..83a53320 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/OrgaUserRelMapperEx.java @@ -0,0 +1,16 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.OrgaUserRel; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/12 9:13 + */ +public interface OrgaUserRelMapperEx { + + int addOrgaUserRel(OrgaUserRel orgaUserRel); + + int updateOrgaUserRel(OrgaUserRel orgaUserRel); +} diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapper.java new file mode 100644 index 00000000..3aa3ded9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Organization; +import com.wansensoft.erp.datasource.entities.OrganizationExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface OrganizationMapper { + long countByExample(OrganizationExample example); + + int deleteByExample(OrganizationExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapperEx.java new file mode 100644 index 00000000..8ccba459 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/OrganizationMapperEx.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Organization; +import com.wansensoft.erp.datasource.vo.TreeNode; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:51 + */ +public interface OrganizationMapperEx { + + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapper.java new file mode 100644 index 00000000..a7e63177 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Person; +import com.wansensoft.erp.datasource.entities.PersonExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface PersonMapper { + long countByExample(PersonExample example); + + int deleteByExample(PersonExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapperEx.java new file mode 100644 index 00000000..056acb89 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/PersonMapperEx.java @@ -0,0 +1,21 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Person; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PersonMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapper.java new file mode 100644 index 00000000..044a809e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.PlatformConfig; +import com.wansensoft.erp.datasource.entities.PlatformConfigExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface PlatformConfigMapper { + long countByExample(PlatformConfigExample example); + + int deleteByExample(PlatformConfigExample example); + + int deleteByPrimaryKey(Long id); + + int insert(PlatformConfig record); + + int insertSelective(PlatformConfig record); + + List selectByExample(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/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapperEx.java new file mode 100644 index 00000000..e4b32c81 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/PlatformConfigMapperEx.java @@ -0,0 +1,18 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.PlatformConfig; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PlatformConfigMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapper.java new file mode 100644 index 00000000..3d7db233 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Role; +import com.wansensoft.erp.datasource.entities.RoleExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface RoleMapper { + long countByExample(RoleExample example); + + int deleteByExample(RoleExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapperEx.java new file mode 100644 index 00000000..f25991c4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/RoleMapperEx.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Role; +import com.wansensoft.erp.datasource.entities.RoleEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface RoleMapperEx { + + 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[]); + + Role getRoleWithoutTenant( + @Param("roleId") Long roleId); +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/SequenceMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SequenceMapperEx.java new file mode 100644 index 00000000..109704a2 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SequenceMapperEx.java @@ -0,0 +1,13 @@ +package com.wansensoft.erp.datasource.mappers; + +import org.apache.ibatis.annotations.Param; + +public interface SequenceMapperEx { + + void updateBuildOnlyNumber(); + + /** + * 获得一个全局唯一的数作为订单号的追加 + * */ + Long getBuildOnlyNumber(@Param("seq_name") String seq_name); +} diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapper.java new file mode 100644 index 00000000..57eb198b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.SerialNumber; +import com.wansensoft.erp.datasource.entities.SerialNumberExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SerialNumberMapper { + long countByExample(SerialNumberExample example); + + int deleteByExample(SerialNumberExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapperEx.java new file mode 100644 index 00000000..fae492c3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SerialNumberMapperEx.java @@ -0,0 +1,56 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.SerialNumberEx; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 17:09 + */ +public interface SerialNumberMapperEx { + /** + * 新增序列号信息 + * */ + 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/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapper.java new file mode 100644 index 00000000..230f4133 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Supplier; +import com.wansensoft.erp.datasource.entities.SupplierExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SupplierMapper { + long countByExample(SupplierExample example); + + int deleteByExample(SupplierExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapperEx.java new file mode 100644 index 00000000..bbf373c4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SupplierMapperEx.java @@ -0,0 +1,38 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Supplier; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface SupplierMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapper.java new file mode 100644 index 00000000..788cc3b4 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.SystemConfig; +import com.wansensoft.erp.datasource.entities.SystemConfigExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface SystemConfigMapper { + long countByExample(SystemConfigExample example); + + int deleteByExample(SystemConfigExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapperEx.java new file mode 100644 index 00000000..c0a82059 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/SystemConfigMapperEx.java @@ -0,0 +1,20 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.SystemConfig; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface SystemConfigMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapper.java new file mode 100644 index 00000000..63bb31d5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Tenant; +import com.wansensoft.erp.datasource.entities.TenantExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface TenantMapper { + long countByExample(TenantExample example); + + int deleteByExample(TenantExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Tenant record); + + int insertSelective(Tenant record); + + List selectByExample(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/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapperEx.java new file mode 100644 index 00000000..fea3345e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/TenantMapperEx.java @@ -0,0 +1,23 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.TenantEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TenantMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapper.java new file mode 100644 index 00000000..ed2ccd43 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Unit; +import com.wansensoft.erp.datasource.entities.UnitExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface UnitMapper { + long countByExample(UnitExample example); + + int deleteByExample(UnitExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapperEx.java new file mode 100644 index 00000000..b7fcfea3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UnitMapperEx.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.Unit; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface UnitMapperEx { + + 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/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapper.java new file mode 100644 index 00000000..8e12ea9c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.UserBusiness; +import com.wansensoft.erp.datasource.entities.UserBusinessExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface UserBusinessMapper { + long countByExample(UserBusinessExample example); + + int deleteByExample(UserBusinessExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapperEx.java new file mode 100644 index 00000000..6929f464 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UserBusinessMapperEx.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.datasource.mappers; + +import org.apache.ibatis.annotations.Param; + +import java.util.Date; /** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/29 15:09 + */ +public interface UserBusinessMapperEx { + + int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + +} diff --git a/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapper.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapper.java new file mode 100644 index 00000000..f8c57582 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapper.java @@ -0,0 +1,31 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.entities.UserExample; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +public interface UserMapper { + long countByExample(UserExample example); + + int deleteByExample(UserExample example); + + int deleteByPrimaryKey(Long id); + + int insert(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/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapperEx.java b/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapperEx.java new file mode 100644 index 00000000..714568e3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/mappers/UserMapperEx.java @@ -0,0 +1,44 @@ +package com.wansensoft.erp.datasource.mappers; + +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.entities.UserEx; +import com.wansensoft.erp.datasource.vo.TreeNodeEx; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +public interface UserMapperEx { + + 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); + + 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); + + void disableUserByLimit(@Param("tenantId") Long tenantId); + + List getListByOrgaId( + @Param("id") Long id, + @Param("orgaId") Long orgaId); + + User getUserByWeixinOpenId( + @Param("weixinOpenId") String weixinOpenId); + + int updateUserWithWeixinOpenId( + @Param("loginName") String loginName, + @Param("password") String password, + @Param("weixinOpenId") String weixinOpenId); +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/AccountItemVo4List.java b/src/main/java/com/wansensoft/erp/datasource/vo/AccountItemVo4List.java new file mode 100644 index 00000000..d27f489a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/AccountItemVo4List.java @@ -0,0 +1,36 @@ +package com.wansensoft.erp.datasource.vo; + +import com.wansensoft.erp.datasource.entities.AccountItem; + +public class AccountItemVo4List extends AccountItem { + + private String accountName; + + private String inOutItemName; + + private String billNumber; + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getInOutItemName() { + return inOutItemName; + } + + public void setInOutItemName(String inOutItemName) { + this.inOutItemName = inOutItemName; + } + + public String getBillNumber() { + return billNumber; + } + + public void setBillNumber(String billNumber) { + this.billNumber = billNumber; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4InOutList.java b/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4InOutList.java new file mode 100644 index 00000000..bf5d4b99 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4InOutList.java @@ -0,0 +1,116 @@ +package com.wansensoft.erp.datasource.vo; + +import java.math.BigDecimal; + +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; + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFromType() { + return fromType; + } + + public void setFromType(String fromType) { + this.fromType = fromType; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public BigDecimal getChangeAmount() { + return changeAmount; + } + + public void setChangeAmount(BigDecimal changeAmount) { + this.changeAmount = changeAmount; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public String getOperTime() { + return operTime; + } + + public void setOperTime(String operTime) { + this.operTime = operTime; + } + + public String getaList() { + return aList; + } + + public void setaList(String aList) { + this.aList = aList; + } + + public String getAmList() { + return amList; + } + + public void setAmList(String amList) { + this.amList = amList; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4List.java b/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4List.java new file mode 100644 index 00000000..0e5bf006 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/AccountVo4List.java @@ -0,0 +1,16 @@ +package com.wansensoft.erp.datasource.vo; + +import com.wansensoft.erp.datasource.entities.Account; + +public class AccountVo4List extends Account { + + private String thisMonthAmount; + + public String getThisMonthAmount() { + return thisMonthAmount; + } + + public void setThisMonthAmount(String thisMonthAmount) { + this.thisMonthAmount = thisMonthAmount; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InDetail.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InDetail.java new file mode 100644 index 00000000..8a80463b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InDetail.java @@ -0,0 +1,188 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public String getNumber() { + return Number; + } + + public void setNumber(String number) { + Number = number; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getMName() { + return MName; + } + + public void setMName(String MName) { + this.MName = MName; + } + + public String getModel() { + return Model; + } + + public void setModel(String model) { + Model = model; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public BigDecimal getUnitPrice() { + return UnitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + UnitPrice = unitPrice; + } + + public String getmUnit() { + return mUnit; + } + + public void setmUnit(String mUnit) { + this.mUnit = mUnit; + } + + public String getNewRemark() { + return newRemark; + } + + public void setNewRemark(String newRemark) { + this.newRemark = newRemark; + } + + public BigDecimal getOperNumber() { + return OperNumber; + } + + public void setOperNumber(BigDecimal operNumber) { + OperNumber = operNumber; + } + + public BigDecimal getAllPrice() { + return AllPrice; + } + + public void setAllPrice(BigDecimal allPrice) { + AllPrice = allPrice; + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public BigDecimal getTaxMoney() { + return taxMoney; + } + + public void setTaxMoney(BigDecimal taxMoney) { + this.taxMoney = taxMoney; + } + + public BigDecimal getTaxLastMoney() { + return taxLastMoney; + } + + public void setTaxLastMoney(BigDecimal taxLastMoney) { + this.taxLastMoney = taxLastMoney; + } + + public String getSName() { + return SName; + } + + public void setSName(String SName) { + this.SName = SName; + } + + public String getDName() { + return DName; + } + + public void setDName(String DName) { + this.DName = DName; + } + + public String getOperTime() { + return OperTime; + } + + public void setOperTime(String operTime) { + OperTime = operTime; + } + + public String getNewType() { + return NewType; + } + + public void setNewType(String newType) { + NewType = newType; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InOutMCount.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InOutMCount.java new file mode 100644 index 00000000..e8f1dccc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4InOutMCount.java @@ -0,0 +1,107 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; + +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; + + public Long getMaterialId() { + return MaterialId; + } + + public void setMaterialId(Long materialId) { + MaterialId = materialId; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getmName() { + return mName; + } + + public void setmName(String mName) { + this.mName = mName; + } + + public String getModel() { + return Model; + } + + public void setModel(String model) { + Model = model; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getMaterialUnit() { + return materialUnit; + } + + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit; + } + + public BigDecimal getNumSum() { + return numSum; + } + + public void setNumSum(BigDecimal numSum) { + this.numSum = numSum; + } + + public BigDecimal getPriceSum() { + return priceSum; + } + + public void setPriceSum(BigDecimal priceSum) { + this.priceSum = priceSum; + } + + public Long getTenantId() { + return tenantId; + } + + public void setTenantId(Long tenantId) { + this.tenantId = tenantId; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4List.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4List.java new file mode 100644 index 00000000..3317cc7d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4List.java @@ -0,0 +1,226 @@ +package com.wansensoft.erp.datasource.vo; + +import com.wansensoft.erp.datasource.entities.DepotHead; + +import java.math.BigDecimal; + +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; + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getOrganName() { + return organName; + } + + public void setOrganName(String organName) { + this.organName = organName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getAllocationProjectName() { + return allocationProjectName; + } + + public void setAllocationProjectName(String allocationProjectName) { + this.allocationProjectName = allocationProjectName; + } + + public String getMaterialsList() { + return materialsList; + } + + public void setMaterialsList(String materialsList) { + this.materialsList = materialsList; + } + + public String getSalesManStr() { + return salesManStr; + } + + public void setSalesManStr(String salesManStr) { + this.salesManStr = salesManStr; + } + + public String getOperTimeStr() { + return operTimeStr; + } + + public void setOperTimeStr(String operTimeStr) { + this.operTimeStr = operTimeStr; + } + + public BigDecimal getFinishDebt() { + return finishDebt; + } + + public void setFinishDebt(BigDecimal finishDebt) { + this.finishDebt = finishDebt; + } + + public String getDepotHeadType() { + return depotHeadType; + } + + public void setDepotHeadType(String depotHeadType) { + this.depotHeadType = depotHeadType; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public BigDecimal getFinishDeposit() { + return finishDeposit; + } + + public void setFinishDeposit(BigDecimal finishDeposit) { + this.finishDeposit = finishDeposit; + } + + public BigDecimal getNeedDebt() { + return needDebt; + } + + public void setNeedDebt(BigDecimal needDebt) { + this.needDebt = needDebt; + } + + public BigDecimal getDebt() { + return debt; + } + + public void setDebt(BigDecimal debt) { + this.debt = debt; + } + + public BigDecimal getMaterialCount() { + return materialCount; + } + + public void setMaterialCount(BigDecimal materialCount) { + this.materialCount = materialCount; + } + + public Boolean getHasFinancialFlag() { + return hasFinancialFlag; + } + + public void setHasFinancialFlag(Boolean hasFinancialFlag) { + this.hasFinancialFlag = hasFinancialFlag; + } + + public Boolean getHasBackFlag() { + return hasBackFlag; + } + + public void setHasBackFlag(Boolean hasBackFlag) { + this.hasBackFlag = hasBackFlag; + } + + public BigDecimal getRealNeedDebt() { + return realNeedDebt; + } + + public void setRealNeedDebt(BigDecimal realNeedDebt) { + this.realNeedDebt = realNeedDebt; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4StatementAccount.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4StatementAccount.java new file mode 100644 index 00000000..bc8a8999 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotHeadVo4StatementAccount.java @@ -0,0 +1,185 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; + +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getPhoneNum() { + return phoneNum; + } + + public void setPhoneNum(String phoneNum) { + this.phoneNum = phoneNum; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public BigDecimal getBeginNeed() { + return beginNeed; + } + + public void setBeginNeed(BigDecimal beginNeed) { + this.beginNeed = beginNeed; + } + + public BigDecimal getPreDebtMoney() { + return preDebtMoney; + } + + public void setPreDebtMoney(BigDecimal preDebtMoney) { + this.preDebtMoney = preDebtMoney; + } + + public BigDecimal getPreReturnDebtMoney() { + return preReturnDebtMoney; + } + + public void setPreReturnDebtMoney(BigDecimal preReturnDebtMoney) { + this.preReturnDebtMoney = preReturnDebtMoney; + } + + public BigDecimal getPreBackMoney() { + return preBackMoney; + } + + public void setPreBackMoney(BigDecimal preBackMoney) { + this.preBackMoney = preBackMoney; + } + + public BigDecimal getPreNeed() { + return preNeed; + } + + public void setPreNeed(BigDecimal preNeed) { + this.preNeed = preNeed; + } + + public BigDecimal getDebtMoney() { + return debtMoney; + } + + public void setDebtMoney(BigDecimal debtMoney) { + this.debtMoney = debtMoney; + } + + public BigDecimal getReturnDebtMoney() { + return returnDebtMoney; + } + + public void setReturnDebtMoney(BigDecimal returnDebtMoney) { + this.returnDebtMoney = returnDebtMoney; + } + + public BigDecimal getBackMoney() { + return backMoney; + } + + public void setBackMoney(BigDecimal backMoney) { + this.backMoney = backMoney; + } + + public BigDecimal getAllNeed() { + return allNeed; + } + + public void setAllNeed(BigDecimal allNeed) { + this.allNeed = allNeed; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemStockWarningCount.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemStockWarningCount.java new file mode 100644 index 00000000..bb6e51f0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemStockWarningCount.java @@ -0,0 +1,197 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; + +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; + + public Long getMId() { + return MId; + } + + public void setMId(Long MId) { + this.MId = MId; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getMName() { + return MName; + } + + public void setMName(String MName) { + this.MName = MName; + } + + public String getMModel() { + return MModel; + } + + public void setMModel(String MModel) { + this.MModel = MModel; + } + + public String getMaterialUnit() { + return MaterialUnit; + } + + public void setMaterialUnit(String materialUnit) { + MaterialUnit = materialUnit; + } + + public String getMColor() { + return MColor; + } + + public void setMColor(String MColor) { + this.MColor = MColor; + } + + public String getMStandard() { + return MStandard; + } + + public void setMStandard(String MStandard) { + this.MStandard = MStandard; + } + + public String getMMfrs() { + return MMfrs; + } + + public void setMMfrs(String MMfrs) { + this.MMfrs = MMfrs; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getMaterialOther() { + return MaterialOther; + } + + public void setMaterialOther(String materialOther) { + MaterialOther = materialOther; + } + + public String getMOtherField1() { + return MOtherField1; + } + + public void setMOtherField1(String MOtherField1) { + this.MOtherField1 = MOtherField1; + } + + public String getMOtherField2() { + return MOtherField2; + } + + public void setMOtherField2(String MOtherField2) { + this.MOtherField2 = MOtherField2; + } + + public String getMOtherField3() { + return MOtherField3; + } + + public void setMOtherField3(String MOtherField3) { + this.MOtherField3 = MOtherField3; + } + + public String getDepotName() { + return depotName; + } + + public void setDepotName(String depotName) { + this.depotName = depotName; + } + + public BigDecimal getCurrentNumber() { + return currentNumber; + } + + public void setCurrentNumber(BigDecimal currentNumber) { + this.currentNumber = currentNumber; + } + + public BigDecimal getLowSafeStock() { + return lowSafeStock; + } + + public void setLowSafeStock(BigDecimal lowSafeStock) { + this.lowSafeStock = lowSafeStock; + } + + public BigDecimal getHighSafeStock() { + return highSafeStock; + } + + public void setHighSafeStock(BigDecimal highSafeStock) { + this.highSafeStock = highSafeStock; + } + + public BigDecimal getLowCritical() { + return lowCritical; + } + + public void setLowCritical(BigDecimal lowCritical) { + this.lowCritical = lowCritical; + } + + public BigDecimal getHighCritical() { + return highCritical; + } + + public void setHighCritical(BigDecimal highCritical) { + this.highCritical = highCritical; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVo4Stock.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVo4Stock.java new file mode 100644 index 00000000..97b9ec61 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVo4Stock.java @@ -0,0 +1,80 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; + +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; + + public BigDecimal getInTotal() { + return inTotal; + } + + public void setInTotal(BigDecimal inTotal) { + this.inTotal = inTotal; + } + + public BigDecimal getOutTotal() { + return outTotal; + } + + public void setOutTotal(BigDecimal outTotal) { + this.outTotal = outTotal; + } + + public BigDecimal getTransfInTotal() { + return transfInTotal; + } + + public void setTransfInTotal(BigDecimal transfInTotal) { + this.transfInTotal = transfInTotal; + } + + public BigDecimal getTransfOutTotal() { + return transfOutTotal; + } + + public void setTransfOutTotal(BigDecimal transfOutTotal) { + this.transfOutTotal = transfOutTotal; + } + + public BigDecimal getAssemInTotal() { + return assemInTotal; + } + + public void setAssemInTotal(BigDecimal assemInTotal) { + this.assemInTotal = assemInTotal; + } + + public BigDecimal getAssemOutTotal() { + return assemOutTotal; + } + + public void setAssemOutTotal(BigDecimal assemOutTotal) { + this.assemOutTotal = assemOutTotal; + } + + public BigDecimal getDisAssemInTotal() { + return disAssemInTotal; + } + + public void setDisAssemInTotal(BigDecimal disAssemInTotal) { + this.disAssemInTotal = disAssemInTotal; + } + + public BigDecimal getDisAssemOutTotal() { + return disAssemOutTotal; + } + + public void setDisAssemOutTotal(BigDecimal disAssemOutTotal) { + this.disAssemOutTotal = disAssemOutTotal; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVoBatchNumberList.java b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVoBatchNumberList.java new file mode 100644 index 00000000..080e9720 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/DepotItemVoBatchNumberList.java @@ -0,0 +1,108 @@ +package com.wansensoft.erp.datasource.vo; + + +import java.math.BigDecimal; +import java.util.Date; + +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; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public String getCommodityUnit() { + return commodityUnit; + } + + public void setCommodityUnit(String commodityUnit) { + this.commodityUnit = commodityUnit; + } + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber; + } + + public Date getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + public String getExpirationDateStr() { + return expirationDateStr; + } + + public void setExpirationDateStr(String expirationDateStr) { + this.expirationDateStr = expirationDateStr; + } + + public BigDecimal getTotalNum() { + return totalNum; + } + + public void setTotalNum(BigDecimal totalNum) { + this.totalNum = totalNum; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/FinishDepositVo.java b/src/main/java/com/wansensoft/erp/datasource/vo/FinishDepositVo.java new file mode 100644 index 00000000..dd61b679 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/FinishDepositVo.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.vo; + +import java.math.BigDecimal; + +public class FinishDepositVo { + + private String number; + + private BigDecimal finishDeposit; + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public BigDecimal getFinishDeposit() { + return finishDeposit; + } + + public void setFinishDeposit(BigDecimal finishDeposit) { + this.finishDeposit = finishDeposit; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/LogVo4List.java b/src/main/java/com/wansensoft/erp/datasource/vo/LogVo4List.java new file mode 100644 index 00000000..bd025e7b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/LogVo4List.java @@ -0,0 +1,36 @@ +package com.wansensoft.erp.datasource.vo; + +import com.wansensoft.erp.datasource.entities.Log; + +public class LogVo4List extends Log { + + private String loginName; + + private String userName; + + private String createTimeStr; + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCreateTimeStr() { + return createTimeStr; + } + + public void setCreateTimeStr(String createTimeStr) { + this.createTimeStr = createTimeStr; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/MaterialCountVo.java b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialCountVo.java new file mode 100644 index 00000000..d5547dd8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialCountVo.java @@ -0,0 +1,26 @@ +package com.wansensoft.erp.datasource.vo; + +import java.math.BigDecimal; + +public class MaterialCountVo { + + private Long headerId; + + private BigDecimal materialCount; + + public Long getHeaderId() { + return headerId; + } + + public void setHeaderId(Long headerId) { + this.headerId = headerId; + } + + public BigDecimal getMaterialCount() { + return materialCount; + } + + public void setMaterialCount(BigDecimal materialCount) { + this.materialCount = materialCount; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/MaterialExtendVo4List.java b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialExtendVo4List.java new file mode 100644 index 00000000..0906d687 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialExtendVo4List.java @@ -0,0 +1,68 @@ +package com.wansensoft.erp.datasource.vo; + +import com.wansensoft.erp.datasource.entities.MaterialExtend; + +import java.math.BigDecimal; + +public class MaterialExtendVo4List extends MaterialExtend { + + private String supplier; + + private String originPlace; + + private String unit; + + private String brandName; + + private BigDecimal guaranteePeriod; + + private BigDecimal memberDecimal; + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getOriginPlace() { + return originPlace; + } + + public void setOriginPlace(String originPlace) { + this.originPlace = originPlace; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getBrandName() { + return brandName; + } + + public void setBrandName(String brandName) { + this.brandName = brandName; + } + + public BigDecimal getGuaranteePeriod() { + return guaranteePeriod; + } + + public void setGuaranteePeriod(BigDecimal guaranteePeriod) { + this.guaranteePeriod = guaranteePeriod; + } + + public BigDecimal getMemberDecimal() { + return memberDecimal; + } + + public void setMemberDecimal(BigDecimal memberDecimal) { + this.memberDecimal = memberDecimal; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/MaterialVoSearch.java b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialVoSearch.java new file mode 100644 index 00000000..189e7d83 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialVoSearch.java @@ -0,0 +1,64 @@ +package com.wansensoft.erp.datasource.vo; + +public class MaterialVoSearch { + + private String barCode; + + private String name; + + private String standard; + + private String model; + + private String color; + + private String unit; + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStandard() { + return standard; + } + + public void setStandard(String standard) { + this.standard = standard; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/MaterialsListVo.java b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialsListVo.java new file mode 100644 index 00000000..87fa27b8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/MaterialsListVo.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.datasource.vo; + +public class MaterialsListVo { + + private Long headerId; + + private String materialsList; + + public Long getHeaderId() { + return headerId; + } + + public void setHeaderId(Long headerId) { + this.headerId = headerId; + } + + public String getMaterialsList() { + return materialsList; + } + + public void setMaterialsList(String materialsList) { + this.materialsList = materialsList; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/NodeAttributes.java b/src/main/java/com/wansensoft/erp/datasource/vo/NodeAttributes.java new file mode 100644 index 00000000..a7844ecc --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/NodeAttributes.java @@ -0,0 +1,30 @@ +package com.wansensoft.erp.datasource.vo; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/13 18:11 + */ +public class NodeAttributes { + //编号 + private String no; + //类型 + private Integer type; + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/TreeNode.java b/src/main/java/com/wansensoft/erp/datasource/vo/TreeNode.java new file mode 100644 index 00000000..8dbf3383 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/TreeNode.java @@ -0,0 +1,114 @@ +package com.wansensoft.erp.datasource.vo; + +import java.util.List; + +/** + * Description + * 树形结构基本元素 + * @Author: cjl + * @Date: 2019/2/19 11:27 + */ +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getKey() { + return key; + } + + public void setKey(Long key) { + this.key = key; + } + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public String getAttributes() { + return attributes; + } + + public void setAttributes(String attributes) { + this.attributes = attributes; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/src/main/java/com/wansensoft/erp/datasource/vo/TreeNodeEx.java b/src/main/java/com/wansensoft/erp/datasource/vo/TreeNodeEx.java new file mode 100644 index 00000000..86e748c5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/datasource/vo/TreeNodeEx.java @@ -0,0 +1,96 @@ +package com.wansensoft.erp.datasource.vo; + +import java.util.List; + +/** + * Description + * + * @Author: qiankunpingtai + * @Date: 2019/3/13 18:10 + */ +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; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public NodeAttributes getAttributes() { + return attributes; + } + + public void setAttributes(NodeAttributes attributes) { + this.attributes = attributes; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/src/main/java/com/wansensoft/erp/exception/BusinessParamCheckingException.java b/src/main/java/com/wansensoft/erp/exception/BusinessParamCheckingException.java new file mode 100644 index 00000000..634f12f3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/exception/BusinessParamCheckingException.java @@ -0,0 +1,32 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/exception/BusinessRunTimeException.java b/src/main/java/com/wansensoft/erp/exception/BusinessRunTimeException.java new file mode 100644 index 00000000..a4cc7d01 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/exception/BusinessRunTimeException.java @@ -0,0 +1,32 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/exception/GlobalExceptionHandler.java b/src/main/java/com/wansensoft/erp/exception/GlobalExceptionHandler.java new file mode 100644 index 00000000..adabbbd0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/exception/GlobalExceptionHandler.java @@ -0,0 +1,47 @@ +package com.wansensoft.erp.exception; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/exception/JshException.java b/src/main/java/com/wansensoft/erp/exception/JshException.java new file mode 100644 index 00000000..06368459 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/exception/JshException.java @@ -0,0 +1,27 @@ +package com.wansensoft.erp.exception; + +import com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/filter/LogCostFilter.java b/src/main/java/com/wansensoft/erp/filter/LogCostFilter.java new file mode 100644 index 00000000..60106424 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/filter/LogCostFilter.java @@ -0,0 +1,74 @@ +package com.wansensoft.erp.filter; + +import com.wansensoft.erp.service.redis.RedisService; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebInitParam; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.util.StringUtils; + +import jakarta.annotation.Resource; +import jakarta.servlet.*; +import java.io.IOException; + +@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"; + + private String[] allowUrls; + @Resource + private RedisService redisService; + + @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}; + } + } + + @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(redisService.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/src/main/java/com/wansensoft/erp/service/CommonQueryManager.java b/src/main/java/com/wansensoft/erp/service/CommonQueryManager.java new file mode 100644 index 00000000..cde936a9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/CommonQueryManager.java @@ -0,0 +1,137 @@ +package com.wansensoft.erp.service; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @author jishenghua 752718920 2018-10-7 15:25:58 + */ +@Service +public class CommonQueryManager { + + @Resource + private InterfaceContainer container; + + @Resource + private LogService logService; + + /** + * 查询单条 + * + * @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/src/main/java/com/wansensoft/erp/service/ICommonQuery.java b/src/main/java/com/wansensoft/erp/service/ICommonQuery.java new file mode 100644 index 00000000..9b16af25 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/ICommonQuery.java @@ -0,0 +1,80 @@ +package com.wansensoft.erp.service; + +import com.alibaba.fastjson.JSONObject; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * 通用查询接口 + * 功能:1、单条查询 2、分页+搜索 3、查询数量 + * + * @author jishenghua + * @version 1.0 + */ +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/src/main/java/com/wansensoft/erp/service/InterfaceContainer.java b/src/main/java/com/wansensoft/erp/service/InterfaceContainer.java new file mode 100644 index 00000000..b77dfcc7 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/InterfaceContainer.java @@ -0,0 +1,30 @@ +package com.wansensoft.erp.service; + +import com.wansensoft.erp.utils.AnnotationUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author jishenghua 2018-10-7 15:25:09 + */ +@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/src/main/java/com/wansensoft/erp/service/ResourceInfo.java b/src/main/java/com/wansensoft/erp/service/ResourceInfo.java new file mode 100644 index 00000000..31a6b33b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/ResourceInfo.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp.service; + +import java.lang.annotation.*; + +/** + * @author jishenghua 2018-10-7 15:25:39 + */ +@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +@Documented +public @interface ResourceInfo { + String value(); +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/service/account/AccountComponent.java b/src/main/java/com/wansensoft/erp/service/account/AccountComponent.java new file mode 100644 index 00000000..9ebb7787 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/account/AccountComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "account_component") +@AccountResource +public class AccountComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/account/AccountResource.java b/src/main/java/com/wansensoft/erp/service/account/AccountResource.java new file mode 100644 index 00000000..3ad7524e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/account/AccountResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.account; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "account") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/account/AccountService.java b/src/main/java/com/wansensoft/erp/service/account/AccountService.java new file mode 100644 index 00000000..66f05d1a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/account/AccountService.java @@ -0,0 +1,624 @@ +package com.wansensoft.erp.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.*; +import com.wansensoft.erp.datasource.vo.AccountVo4InOutList; +import com.wansensoft.erp.datasource.vo.AccountVo4List; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.utils.Tools; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.*; + +@Service +public class AccountService { + private Logger logger = LoggerFactory.getLogger(AccountService.class); + + @Resource + private AccountMapper accountMapper; + + @Resource + private AccountMapperEx accountMapperEx; + + @Resource + private DepotHeadMapper depotHeadMapper; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + + @Resource + private AccountHeadMapper accountHeadMapper; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + + @Resource + private AccountItemMapper accountItemMapper; + @Resource + private AccountItemMapperEx accountItemMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + + public Account getAccount(long id) throws Exception{ + return accountMapper.selectByPrimaryKey(id); + } + + public List getAccountListByIds(String ids)throws Exception { + 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() throws Exception{ + 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) throws Exception{ + 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) throws Exception{ + 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 && null !=timeStr) { + 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)throws Exception { + 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)throws Exception { + Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); + if(account.getInitialAmount() == null) { + account.setInitialAmount(BigDecimal.ZERO); + } + List accountList = getAccountByParam(null, null); + if(accountList.size() == 0) { + account.setIsDefault(true); + } else { + account.setIsDefault(false); + } + account.setEnabled(true); + int result=0; + try{ + result = accountMapper.insertSelective(account); + logService.insertLog("账户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(account.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccount(JSONObject obj, HttpServletRequest request)throws Exception { + 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) throws Exception{ + return batchDeleteAccountByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccount(String ids, HttpServletRequest request)throws Exception { + return batchDeleteAccountByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountByIds(String ids) throws Exception{ + 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.size()>0){ + 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.size()>0){ + 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.size()>0){ + 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=userService.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)throws Exception { + 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()throws Exception { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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) throws Exception{ + List list=null; + try{ + list = accountMapperEx.findAccountInOutList(accountId, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findAccountInOutListCount(Long accountId) throws Exception{ + 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) throws Exception{ + 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() throws Exception { + 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 && null !=timeStr) { + 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)throws Exception { + logService.insertLog("账户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadComponent.java b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadComponent.java new file mode 100644 index 00000000..748d32df --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadComponent.java @@ -0,0 +1,94 @@ +package com.wansensoft.erp.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "accountHead_component") +@AccountHeadResource +public class AccountHeadComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadResource.java b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadResource.java new file mode 100644 index 00000000..8bcffa2d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.accountHead; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "accountHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountHeadResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadService.java b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadService.java new file mode 100644 index 00000000..d8290c61 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountHead/AccountHeadService.java @@ -0,0 +1,399 @@ +package com.wansensoft.erp.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.AccountHeadMapper; +import com.wansensoft.erp.datasource.mappers.AccountHeadMapperEx; +import com.wansensoft.erp.datasource.mappers.AccountItemMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.accountItem.AccountItemService; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.erp.service.supplier.SupplierService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static com.wansensoft.erp.utils.Tools.getCenternTime; + +@Service +public class AccountHeadService { + private Logger logger = LoggerFactory.getLogger(AccountHeadService.class); + @Resource + private AccountHeadMapper accountHeadMapper; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private OrgaUserRelService orgaUserRelService; + @Resource + private AccountItemService accountItemService; + @Resource + private DepotHeadService depotHeadService; + @Resource + private UserService userService; + @Resource + private SupplierService supplierService; + @Resource + private LogService logService; + @Resource + private AccountItemMapperEx accountItemMapperEx; + + public AccountHead getAccountHead(long id) throws Exception { + AccountHead result=null; + try{ + result=accountHeadMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getAccountHeadListByIds(String ids)throws Exception { + 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() throws Exception{ + 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) throws Exception{ + 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(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) throws Exception{ + 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) throws Exception { + 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) throws Exception{ + 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("财务", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountHead(JSONObject obj, HttpServletRequest request)throws Exception { + AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); + int result=0; + try{ + result = accountHeadMapper.updateByPrimaryKeySelective(accountHead); + logService.insertLog("财务", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountHead.getBillNo()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountHead(Long id, HttpServletRequest request)throws Exception { + return batchDeleteAccountHeadByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHead(String ids, HttpServletRequest request)throws Exception { + return batchDeleteAccountHeadByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHeadByIds(String ids)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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.size()>0) { + 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) throws Exception { + 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("财务单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) throws Exception { + 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("财务单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountHead.getBillNo()).toString(), request); + } + + public List getDetailByNumber(String billNo)throws Exception { + 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(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/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemComponent.java b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemComponent.java new file mode 100644 index 00000000..d15748a3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.service.accountItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "accountItem_component") +@AccountItemResource +public class AccountItemComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemResource.java b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemResource.java new file mode 100644 index 00000000..164b42d7 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.accountItem; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "accountItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountItemResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemService.java b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemService.java new file mode 100644 index 00000000..2f5bdbf8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/accountItem/AccountItemService.java @@ -0,0 +1,262 @@ +package com.wansensoft.erp.service.accountItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.AccountItem; +import com.wansensoft.erp.datasource.entities.AccountItemExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.AccountItemMapper; +import com.wansensoft.erp.datasource.mappers.AccountItemMapperEx; +import com.wansensoft.erp.datasource.vo.AccountItemVo4List; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service +public class AccountItemService { + private Logger logger = LoggerFactory.getLogger(AccountItemService.class); + + @Resource + private AccountItemMapper accountItemMapper; + @Resource + private AccountItemMapperEx accountItemMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private DepotHeadService depotHeadService; + + public AccountItem getAccountItem(long id)throws Exception { + AccountItem result=null; + try{ + result=accountItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getAccountItem()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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)throws Exception { + AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class); + int result=0; + try{ + result = accountItemMapper.updateByPrimaryKeySelective(accountItem); + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountItem.getId()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountItem(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result = accountItemMapper.deleteByPrimaryKey(id); + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountItem(String ids, HttpServletRequest request)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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) throws Exception { + //删除单据的明细 + 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)throws Exception { + 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) throws Exception{ + logService.insertLog("财务明细", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((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/src/main/java/com/wansensoft/erp/service/depot/DepotComponent.java b/src/main/java/com/wansensoft/erp/service/depot/DepotComponent.java new file mode 100644 index 00000000..d807c994 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depot/DepotComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.service.depot; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depot_component") +@DepotResource +public class DepotComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/depot/DepotResource.java b/src/main/java/com/wansensoft/erp/service/depot/DepotResource.java new file mode 100644 index 00000000..5398158c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depot/DepotResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.depot; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "depot") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/depot/DepotService.java b/src/main/java/com/wansensoft/erp/service/depot/DepotService.java new file mode 100644 index 00000000..7a069e93 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depot/DepotService.java @@ -0,0 +1,383 @@ +package com.wansensoft.erp.service.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.DepotHeadMapperEx; +import com.wansensoft.erp.datasource.mappers.DepotItemMapperEx; +import com.wansensoft.erp.datasource.mappers.DepotMapper; +import com.wansensoft.erp.datasource.mappers.DepotMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class DepotService { + private Logger logger = LoggerFactory.getLogger(DepotService.class); + + @Resource + private DepotMapper depotMapper; + + @Resource + private DepotMapperEx depotMapperEx; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private UserBusinessService userBusinessService; + @Resource + private LogService logService; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + @Resource + private DepotItemMapperEx depotItemMapperEx; + + public Depot getDepot(long id)throws Exception { + Depot result=null; + try{ + result=depotMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotListByIds(String ids)throws Exception { + 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()throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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("仓库", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depot.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepot(JSONObject obj, HttpServletRequest request) throws Exception{ + Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class); + int result=0; + try{ + result= depotMapper.updateByPrimaryKeySelective(depot); + logService.insertLog("仓库", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depot.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepot(Long id, HttpServletRequest request)throws Exception { + return batchDeleteDepotByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepot(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteDepotByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotByIds(String ids)throws Exception { + 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)throws Exception { + 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()throws Exception{ + 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) throws Exception{ + 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) throws Exception { + 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() throws Exception { + 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.size()>0) { + 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() throws Exception { + 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)throws Exception { + logService.insertLog("仓库", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadComponent.java b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadComponent.java new file mode 100644 index 00000000..42fed270 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadComponent.java @@ -0,0 +1,102 @@ +package com.wansensoft.erp.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depotHead_component") +@DepotHeadResource +public class DepotHeadComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadResource.java b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadResource.java new file mode 100644 index 00000000..5c76da96 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.depotHead; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "depotHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotHeadResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadService.java b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadService.java new file mode 100644 index 00000000..3964b16a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotHead/DepotHeadService.java @@ -0,0 +1,1306 @@ +package com.wansensoft.erp.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.DepotHeadMapper; +import com.wansensoft.erp.datasource.mappers.DepotHeadMapperEx; +import com.wansensoft.erp.datasource.mappers.DepotItemMapperEx; +import com.wansensoft.erp.datasource.vo.*; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.account.AccountService; +import com.wansensoft.erp.service.accountHead.AccountHeadService; +import com.wansensoft.erp.service.accountItem.AccountItemService; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotItem.DepotItemService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.erp.service.person.PersonService; +import com.wansensoft.erp.service.role.RoleService; +import com.wansensoft.erp.service.serialNumber.SerialNumberService; +import com.wansensoft.erp.service.supplier.SupplierService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.*; + +import static com.wansensoft.erp.utils.Tools.getCenternTime; +import static com.wansensoft.erp.utils.Tools.getNow3; + +@Service +public class DepotHeadService { + private Logger logger = LoggerFactory.getLogger(DepotHeadService.class); + + @Resource + private DepotHeadMapper depotHeadMapper; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + @Resource + private UserService userService; + @Resource + private RoleService roleService; + @Resource + private DepotService depotService; + @Resource + DepotItemService depotItemService; + @Resource + private SupplierService supplierService; + @Resource + private UserBusinessService userBusinessService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private SerialNumberService serialNumberService; + @Resource + private OrgaUserRelService orgaUserRelService; + @Resource + private PersonService personService; + @Resource + private AccountService accountService; + @Resource + private AccountHeadService accountHeadService; + @Resource + private AccountItemService accountItemService; + @Resource + DepotItemMapperEx depotItemMapperEx; + @Resource + private LogService logService; + + public DepotHead getDepotHead(long id)throws Exception { + DepotHead result=null; + try{ + result=depotHeadMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotHead()throws Exception { + 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) throws Exception { + 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(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) throws Exception{ + 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) throws Exception { + 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; + } + + /** + * 根据角色类型获取操作员数组 + * @param roleType + * @return + * @throws Exception + */ + public String[] getCreatorArray(String roleType) throws Exception { + String creator = getCreatorByRoleType(roleType); + String [] creatorArray=null; + if(StringUtil.isNotEmpty(creator)){ + creatorArray = creator.split(","); + } + return creatorArray; + } + + /** + * 获取机构数组 + * @return + */ + public String[] getOrganArray(String subType, String purchaseStatus) throws Exception { + String [] organArray = null; + String type = "UserCustomer"; + Long userId = userService.getCurrentUser().getId(); + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); + List supplierList = supplierService.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.size() > 0) { + 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.size() > 0) { + organArray = StringUtil.listToStringArray(organList); + } + } + } + } + return organArray; + } + + /** + * 根据角色类型获取操作员 + * @param roleType + * @return + * @throws Exception + */ + public String getCreatorByRoleType(String roleType) throws Exception { + 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.size()>0) { + List list = depotHeadMapperEx.getFinishDepositByNumberList(numberList); + if(list!=null && list.size()>0) { + for (FinishDepositVo finishDepositVo : list) { + if(finishDepositVo!=null) { + finishDepositMap.put(finishDepositVo.getNumber(), finishDepositVo.getFinishDeposit()); + } + } + } + } + return finishDepositMap; + } + + public Map getBillSizeMapByLinkNumberList(List numberList) throws Exception { + Map billListMap = new HashMap<>(); + if(numberList.size()>0) { + List list = getBillListByLinkNumberList(numberList); + if(list!=null && list.size()>0) { + 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.size()>0) { + List list = accountHeadService.getFinancialBillNoByBillIdList(idList); + if(list!=null && list.size()>0) { + 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)throws Exception { + 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) throws Exception{ + 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("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getId()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepotHead(Long id, HttpServletRequest request)throws Exception { + return batchDeleteBillByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotHead(String ids, HttpServletRequest request)throws Exception { + return batchDeleteBillByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteBillByIds(String ids)throws Exception { + 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.size() > 0) { + //单据明细里面存在序列号商品 + 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.size() > 0) { + 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) { + supplierService.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.size()>0) { + 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.size()>0) { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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.size()>0) { + 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)throws Exception { + Map materialsListMap = new HashMap<>(); + if(idList.size()>0) { + 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)throws Exception { + Map materialCountListMap = new HashMap<>(); + if(idList.size()>0) { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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(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)throws Exception { + 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)throws Exception { + if(linkNumberList!=null && linkNumberList.size()>0) { + 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)throws Exception { + 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)throws Exception { + 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) throws Exception { + /**处理单据主表数据*/ + 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 = supplierService.getSupplier(depotHead.getOrganId()).getAdvanceIn(); + if(currentAdvanceIn.compareTo(depotHead.getTotalPrice())>=0) { + supplierService.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("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(), + ((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)throws Exception { + /**更新单据主表信息*/ + 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 = supplierService.getSupplier(depotHead.getOrganId()).getAdvanceIn(); + if(currentAdvanceIn.compareTo(depotHead.getTotalPrice())>=0) { + supplierService.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("单据", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(), + ((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 = accountItemService.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) throws Exception { + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + String [] creatorArray = getCreatorArray(roleType); + Map map = new HashMap<>(); + //今日 + BigDecimal todayBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, today, getNow3(), creatorArray); //今日采购入库 + BigDecimal todayBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, today, getNow3(), creatorArray); //今日采购退货 + BigDecimal todaySale = getBuyAndSaleBasicStatistics("出库", "销售", + 1, today, getNow3(), creatorArray); //今日销售出库 + BigDecimal todaySaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1, today, getNow3(), creatorArray); //今日销售退货 + BigDecimal todayRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + today, getNow3(), creatorArray); //今日零售出库 + BigDecimal todayRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + today, getNow3(), creatorArray); //今日零售退货 + //本月 + BigDecimal monthBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, monthFirstDay, getNow3(), creatorArray); //本月采购入库 + BigDecimal monthBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, monthFirstDay, getNow3(), creatorArray); //本月采购退货 + BigDecimal monthSale = getBuyAndSaleBasicStatistics("出库", "销售", + 1,monthFirstDay, getNow3(), creatorArray); //本月销售出库 + BigDecimal monthSaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1,monthFirstDay, getNow3(), creatorArray); //本月销售退货 + BigDecimal monthRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + monthFirstDay, getNow3(), creatorArray); //本月零售出库 + BigDecimal monthRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + monthFirstDay, 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) throws Exception { + 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) throws Exception { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime, creatorArray, forceFlag).abs(); + } + + public DepotHead getDepotHead(String number)throws Exception { + 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.size()>0) { + 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(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 = accountItemService.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"; + } + } +} diff --git a/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemComponent.java b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemComponent.java new file mode 100644 index 00000000..6d66e4e0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.service.depotItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "depotItem_component") +@DepotItemResource +public class DepotItemComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemResource.java b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemResource.java new file mode 100644 index 00000000..62a9d385 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.depotItem; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "depotItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotItemResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemService.java b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemService.java new file mode 100644 index 00000000..62210b4d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/depotItem/DepotItemService.java @@ -0,0 +1,1227 @@ +package com.wansensoft.erp.service.depotItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.*; +import com.wansensoft.erp.datasource.vo.DepotItemStockWarningCount; +import com.wansensoft.erp.datasource.vo.DepotItemVo4Stock; +import com.wansensoft.erp.datasource.vo.DepotItemVoBatchNumberList; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.material.MaterialService; +import com.wansensoft.erp.service.materialExtend.MaterialExtendService; +import com.wansensoft.erp.service.serialNumber.SerialNumberService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.unit.UnitService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +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 DepotItemService { + private Logger logger = LoggerFactory.getLogger(DepotItemService.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"; + + @Resource + private DepotItemMapper depotItemMapper; + @Resource + private DepotItemMapperEx depotItemMapperEx; + @Resource + private MaterialService materialService; + @Resource + private MaterialExtendService materialExtendService; + @Resource + private SerialNumberMapperEx serialNumberMapperEx; + @Resource + private DepotHeadService depotHeadService; + @Resource + private DepotHeadMapper depotHeadMapper; + @Resource + private SerialNumberService serialNumberService; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private DepotService depotService; + @Resource + private UnitService unitService; + @Resource + private MaterialCurrentStockMapper materialCurrentStockMapper; + @Resource + private LogService logService; + + public DepotItem getDepotItem(long id)throws Exception { + DepotItem result=null; + try{ + result=depotItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotItem()throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + int result =0; + try{ + result = depotItemMapper.updateByPrimaryKeySelective(depotItem); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getListByHeaderId(Long headerId)throws Exception { + 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)throws Exception { + 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; + } + + /** + * 查询被关联订单中指定商品的明细信息 + * @param linkNumber + * @param meId + * @return + * @throws Exception + */ + public DepotItem getPreItemByHeaderIdAndMaterial(String linkNumber, Long meId, Long linkId)throws Exception { + DepotItem depotItem = new DepotItem(); + try{ + DepotHead depotHead = depotHeadService.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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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; + + } + + /** + * 统计采购或销售的总金额 + * @param type + * @param subType + * @param month + * @return + * @throws Exception + */ + public BigDecimal inOrOutPrice(String type, String subType, String month, String roleType) throws Exception{ + BigDecimal result= BigDecimal.ZERO; + try{ + String [] creatorArray = depotHeadService.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) throws Exception{ + BigDecimal result= BigDecimal.ZERO; + try{ + String [] creatorArray = depotHeadService.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) throws Exception{ + //查询单据主表信息 + DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId); + //删除序列号和回收序列号 + deleteOrCancelSerialNumber(actionType, depotHead, headerId); + //删除单据的明细 + deleteDepotItemHeadId(headerId); + JSONArray rowArr = JSONArray.parseArray(rows); + if (null != rowArr && rowArr.size()>0) { + //针对组装单、拆卸单校验是否存在组合件和普通子件 + 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= materialService.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 = materialService.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 = depotHeadService.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.size() > 0){ + return depotItemList.get(0); + } else { + return new DepotItem(); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteDepotItemHeadId(Long headerId)throws Exception { + 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) throws Exception { + 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.size() > 0){ + 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) throws Exception { + 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) throws Exception { + 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) throws Exception { + 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) throws Exception { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + //初始库存 + BigDecimal initStock = materialService.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) throws Exception { + 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) throws Exception { + 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) throws Exception { + 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.size()>0) { + 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) throws Exception { + 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) throws Exception { + 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/src/main/java/com/wansensoft/erp/service/functions/FunctionComponent.java b/src/main/java/com/wansensoft/erp/service/functions/FunctionComponent.java new file mode 100644 index 00000000..e8727762 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/functions/FunctionComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "function_component") +@FunctionResource +public class FunctionComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/functions/FunctionResource.java b/src/main/java/com/wansensoft/erp/service/functions/FunctionResource.java new file mode 100644 index 00000000..177b078a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/functions/FunctionResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.functions; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "function") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface FunctionResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/functions/FunctionService.java b/src/main/java/com/wansensoft/erp/service/functions/FunctionService.java new file mode 100644 index 00000000..c8ea14e1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/functions/FunctionService.java @@ -0,0 +1,244 @@ +package com.wansensoft.erp.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.Function; +import com.wansensoft.erp.datasource.entities.FunctionEx; +import com.wansensoft.erp.datasource.entities.FunctionExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.FunctionMapper; +import com.wansensoft.erp.datasource.mappers.FunctionMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class FunctionService { + private Logger logger = LoggerFactory.getLogger(FunctionService.class); + + @Resource + private FunctionMapper functionsMapper; + + @Resource + private FunctionMapperEx functionMapperEx; + @Resource + private UserService userService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private LogService logService; + + public Function getFunction(long id)throws Exception { + Function result=null; + try{ + result=functionsMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getFunctionListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + functions.setState(false); + functions.setType("电脑版"); + result = functionsMapper.insertSelective(functions); + logService.insertLog("功能", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(functions.getName()).toString(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateFunction(JSONObject obj, HttpServletRequest request) throws Exception{ + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = functionsMapper.updateByPrimaryKeySelective(functions); + logService.insertLog("功能", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(functions.getName()).toString(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteFunction(Long id, HttpServletRequest request)throws Exception { + return batchDeleteFunctionByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunction(String ids, HttpServletRequest request)throws Exception { + return batchDeleteFunctionByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunctionByIds(String ids)throws Exception { + 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=userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception{ + 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)throws Exception{ + 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/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemComponent.java b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemComponent.java new file mode 100644 index 00000000..dfe97619 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.erp.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "inOutItem_component") +@InOutItemResource +public class InOutItemComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemResource.java b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemResource.java new file mode 100644 index 00000000..29f9dd28 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.inOutItem; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "inOutItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface InOutItemResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemService.java b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemService.java new file mode 100644 index 00000000..180599c6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/inOutItem/InOutItemService.java @@ -0,0 +1,229 @@ +package com.wansensoft.erp.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.AccountItem; +import com.wansensoft.erp.datasource.entities.InOutItem; +import com.wansensoft.erp.datasource.entities.InOutItemExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.AccountItemMapperEx; +import com.wansensoft.erp.datasource.mappers.InOutItemMapper; +import com.wansensoft.erp.datasource.mappers.InOutItemMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class InOutItemService { + private Logger logger = LoggerFactory.getLogger(InOutItemService.class); + + @Resource + private InOutItemMapper inOutItemMapper; + + @Resource + private InOutItemMapperEx inOutItemMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private AccountItemMapperEx accountItemMapperEx; + + public InOutItem getInOutItem(long id)throws Exception { + InOutItem result=null; + try{ + result=inOutItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getInOutItemListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + inOutItem.setEnabled(true); + result=inOutItemMapper.insertSelective(inOutItem); + logService.insertLog("收支项目", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(inOutItem.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateInOutItem(JSONObject obj, HttpServletRequest request)throws Exception { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + result=inOutItemMapper.updateByPrimaryKeySelective(inOutItem); + logService.insertLog("收支项目", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(inOutItem.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteInOutItem(Long id, HttpServletRequest request)throws Exception { + return batchDeleteInOutItemByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItem(String ids, HttpServletRequest request)throws Exception { + return batchDeleteInOutItemByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItemByIds(String ids)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + logService.insertLog("收支项目", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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/src/main/java/com/wansensoft/erp/service/log/LogComponent.java b/src/main/java/com/wansensoft/erp/service/log/LogComponent.java new file mode 100644 index 00000000..1223e4b1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/log/LogComponent.java @@ -0,0 +1,83 @@ +package com.wansensoft.erp.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "log_component") +@LogResource +public class LogComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/log/LogResource.java b/src/main/java/com/wansensoft/erp/service/log/LogResource.java new file mode 100644 index 00000000..9ce0e43b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/log/LogResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.log; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "log") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface LogResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/log/LogService.java b/src/main/java/com/wansensoft/erp/service/log/LogService.java new file mode 100644 index 00000000..631a6c35 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/log/LogService.java @@ -0,0 +1,189 @@ +package com.wansensoft.erp.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.Log; +import com.wansensoft.erp.datasource.entities.LogExample; +import com.wansensoft.erp.datasource.mappers.LogMapper; +import com.wansensoft.erp.datasource.mappers.LogMapperEx; +import com.wansensoft.erp.datasource.vo.LogVo4List; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +import static com.wansensoft.erp.utils.Tools.getLocalIp; + +@Service +public class LogService { + private Logger logger = LoggerFactory.getLogger(LogService.class); + @Resource + private LogMapper logMapper; + + @Resource + private LogMapperEx logMapperEx; + + @Resource + private UserService userService; + + @Resource + private RedisService redisService; + + public Log getLog(long id)throws Exception { + Log result=null; + try{ + result=logMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getLog()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception{ + try{ + Long userId = userService.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)throws Exception{ + 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/src/main/java/com/wansensoft/erp/service/material/MaterialComponent.java b/src/main/java/com/wansensoft/erp/service/material/MaterialComponent.java new file mode 100644 index 00000000..25a4fdf8 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/material/MaterialComponent.java @@ -0,0 +1,94 @@ +package com.wansensoft.erp.service.material; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "material_component") +@MaterialResource +public class MaterialComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/material/MaterialResource.java b/src/main/java/com/wansensoft/erp/service/material/MaterialResource.java new file mode 100644 index 00000000..afeb30ba --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/material/MaterialResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.material; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "material") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/material/MaterialService.java b/src/main/java/com/wansensoft/erp/service/material/MaterialService.java new file mode 100644 index 00000000..e530a649 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/material/MaterialService.java @@ -0,0 +1,1373 @@ +package com.wansensoft.erp.service.material; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.*; +import com.wansensoft.erp.datasource.vo.MaterialVoSearch; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.depot.DepotService; +import com.wansensoft.erp.service.depotItem.DepotItemService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.materialCategory.MaterialCategoryService; +import com.wansensoft.erp.service.materialExtend.MaterialExtendService; +import com.wansensoft.erp.service.unit.UnitService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ExcelUtils; +import com.wansensoft.erp.utils.StringUtil; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + +@Service +public class MaterialService { + private Logger logger = LoggerFactory.getLogger(MaterialService.class); + + @Resource + private MaterialMapper materialMapper; + @Resource + private MaterialExtendMapper materialExtendMapper; + @Resource + private MaterialMapperEx materialMapperEx; + @Resource + private MaterialCategoryMapperEx materialCategoryMapperEx; + @Resource + private MaterialExtendMapperEx materialExtendMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private DepotItemMapperEx depotItemMapperEx; + @Resource + private DepotItemService depotItemService; + @Resource + private MaterialCategoryService materialCategoryService; + @Resource + private UnitService unitService; + @Resource + private MaterialInitialStockMapper materialInitialStockMapper; + @Resource + private MaterialInitialStockMapperEx materialInitialStockMapperEx; + @Resource + private MaterialCurrentStockMapper materialCurrentStockMapper; + @Resource + private MaterialCurrentStockMapperEx materialCurrentStockMapperEx; + @Resource + private DepotService depotService; + @Resource + private MaterialExtendService materialExtendService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + public Material getMaterial(long id)throws Exception { + Material result=null; + try{ + result=materialMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialListByIds(String ids)throws Exception { + 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() throws Exception{ + 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) + throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(m.getName()).toString(), 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) throws Exception{ + 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("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(material.getName()).toString(), 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)throws Exception { + return batchDeleteMaterialByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialByIds(String ids) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + logService.insertLog("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).toString(), + ((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)throws Exception{ + Unit unit = new Unit(); + try{ + List list = materialMapperEx.findUnitList(mId); + if(list!=null && list.size()>0) { + unit = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return unit; + } + + public List findById(Long id)throws Exception{ + List list =null; + try{ + list= materialMapperEx.findById(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByIdWithBarCode(Long meId)throws Exception{ + 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)throws Exception{ + 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)throws Exception{ + 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)throws Exception { + 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); + } + } + File file = ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + ExcelUtils.downloadExcel(file, file.getName(), response); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) throws Exception { + 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.size() == 0) { + 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.size()>0) { + batchDeleteInitialStockByMaterialList(deleteInitialStockMaterialIdList); + materialInitialStockMapperEx.batchInsert(insertInitialStockMaterialList); + } + if(insertCurrentStockMaterialList.size()>0) { + batchDeleteCurrentStockByMaterialList(deleteCurrentStockMaterialIdList); + materialCurrentStockMapperEx.batchInsert(insertCurrentStockMaterialList); + } + logService.insertLog("商品", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(), + ((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) { + e.printStackTrace(); + 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) throws Exception { + 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) throws Exception { + 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.size() == 0) { + 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) throws Exception { + 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.size()==0) { + //如果通过组合条件没有查到该商品,则通过条码再查一次 + 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)throws Exception { + List list =null; + try{ + list= materialMapperEx.getMaterialEnableSerialNumberList(q, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long getMaterialEnableSerialNumberCount(String q)throws Exception { + Long count =null; + try{ + count= materialMapperEx.getMaterialEnableSerialNumberCount(q); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return count; + } + + public BigDecimal parseBigDecimalEx(String str) throws Exception{ + if(!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + public BigDecimal parsePrice(String price, String ratio) throws Exception{ + 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.size()>0) { + 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.size()>0) { + 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.size()>0) { + 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.size()>0) { + 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) throws Exception { + 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) throws Exception { + 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) throws Exception { + 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); + } +} diff --git a/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeComponent.java b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeComponent.java new file mode 100644 index 00000000..da776f03 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeComponent.java @@ -0,0 +1,70 @@ +package com.wansensoft.erp.service.materialAttribute; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialAttribute_component") +@MaterialAttributeResource +public class MaterialAttributeComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeResource.java b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeResource.java new file mode 100644 index 00000000..434415ec --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.materialAttribute; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2021-07-21 22:26:27 + */ +@ResourceInfo(value = "materialAttribute") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialAttributeResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeService.java b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeService.java new file mode 100644 index 00000000..c2113dbb --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialAttribute/MaterialAttributeService.java @@ -0,0 +1,174 @@ +package com.wansensoft.erp.service.materialAttribute; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.MaterialAttribute; +import com.wansensoft.erp.datasource.entities.MaterialAttributeExample; +import com.wansensoft.erp.datasource.mappers.MaterialAttributeMapper; +import com.wansensoft.erp.datasource.mappers.MaterialAttributeMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +@Service +public class MaterialAttributeService { + private Logger logger = LoggerFactory.getLogger(MaterialAttributeService.class); + + @Resource + private LogService logService; + + @Resource + private MaterialAttributeMapper materialAttributeMapper; + + @Resource + private MaterialAttributeMapperEx materialAttributeMapperEx; + + public MaterialAttribute getMaterialAttribute(long id)throws Exception { + MaterialAttribute result=null; + try{ + result=materialAttributeMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialAttribute() throws Exception{ + 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) + throws Exception{ + 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)throws Exception { + 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)throws Exception { + MaterialAttribute m = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.insertSelective(m); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(m.getAttributeName()).toString(), 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) throws Exception{ + MaterialAttribute materialAttribute = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.updateByPrimaryKeySelective(materialAttribute); + logService.insertLog("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialAttribute.getAttributeName()).toString(), 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)throws Exception { + return batchDeleteMaterialAttributeByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttribute(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialAttributeByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttributeByIds(String ids) throws Exception{ + 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)throws Exception { + 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.size()>0) { + return list.get(0); + } else { + return null; + } + } +} diff --git a/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryComponent.java b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryComponent.java new file mode 100644 index 00000000..b7215938 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialCategory_component") +@MaterialCategoryResource +public class MaterialCategoryComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryResource.java b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryResource.java new file mode 100644 index 00000000..d6a82bd5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.materialCategory; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "materialCategory") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialCategoryResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryService.java b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryService.java new file mode 100644 index 00000000..4e76a7f5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialCategory/MaterialCategoryService.java @@ -0,0 +1,372 @@ +package com.wansensoft.erp.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.MaterialCategoryMapper; +import com.wansensoft.erp.datasource.mappers.MaterialCategoryMapperEx; +import com.wansensoft.erp.datasource.mappers.MaterialMapperEx; +import com.wansensoft.erp.datasource.vo.TreeNode; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialCategoryService { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryService.class); + + @Resource + private MaterialCategoryMapper materialCategoryMapper; + @Resource + private MaterialCategoryMapperEx materialCategoryMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private MaterialMapperEx materialMapperEx; + + public MaterialCategory getMaterialCategory(long id)throws Exception { + MaterialCategory result=null; + try{ + result=materialCategoryMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialCategoryListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + List list=null; + try{ + list = getMCList(parentId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getMCList(Long parentId)throws Exception { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialCategory.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialCategory(JSONObject obj, HttpServletRequest request) throws Exception{ + MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class); + materialCategory.setUpdateTime(new Date()); + int result=0; + try{ + result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory); + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialCategory.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception { + return batchDeleteMaterialCategoryByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategory(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialCategoryByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategoryByIds(String ids) throws Exception { + 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.size()>0){ + 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.size()>0) { + 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)throws Exception { + 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)throws Exception { + 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; + } + /** + * create by: cjl + * description: + *获取商品类别树数据 + * create time: 2019/2/19 14:30 + * @Param: + * @return java.util.List + */ + public List getMaterialCategoryTree(Long id) throws Exception{ + 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) throws Exception { + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(mc.getName()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + if(mc==null){ + return 0; + } + 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) throws Exception{ + logService.insertLog("商品类型", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getName()).toString(), + ((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)throws Exception { + 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.size()<1){ + //未查询到对应数据,编号可用 + 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.size()>0) { + categoryId = list.get(0).getId(); + } + return categoryId; + } +} diff --git a/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendComponent.java b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendComponent.java new file mode 100644 index 00000000..10924d84 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendComponent.java @@ -0,0 +1,65 @@ +package com.wansensoft.erp.service.materialExtend; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "material_extend") +@MaterialExtendResource +public class MaterialExtendComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendResource.java b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendResource.java new file mode 100644 index 00000000..7bc92206 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.materialExtend; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "materialExtend") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialExtendResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendService.java b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendService.java new file mode 100644 index 00000000..3c1b9995 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialExtend/MaterialExtendService.java @@ -0,0 +1,407 @@ +package com.wansensoft.erp.service.materialExtend; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.MaterialExtend; +import com.wansensoft.erp.datasource.entities.MaterialExtendExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.MaterialExtendMapper; +import com.wansensoft.erp.datasource.mappers.MaterialExtendMapperEx; +import com.wansensoft.erp.datasource.vo.MaterialExtendVo4List; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +@Service +public class MaterialExtendService { + private Logger logger = LoggerFactory.getLogger(MaterialExtendService.class); + + @Resource + private MaterialExtendMapper materialExtendMapper; + @Resource + private MaterialExtendMapperEx materialExtendMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private RedisService redisService; + + public MaterialExtend getMaterialExtend(long id)throws Exception { + 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) throws Exception { + 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)throws Exception { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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.size()>0) { + 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.size()>0) { + 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)throws Exception { + 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.size()>0) { + return list.get(0); + } else { + return null; + } + } + + /** + * 查询某个商品里面被清除的条码信息 + * @param barCodeList + * @param mId + * @return + * @throws Exception + */ + public List getMeListByBarCodeAndMid(List barCodeList, Long mId)throws Exception { + List list = new ArrayList<>(); + if(barCodeList.size()>0) { + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andBarCodeNotIn(barCodeList).andMaterialIdEqualTo(mId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = materialExtendMapper.selectByExample(example); + } + return list; + } +} diff --git a/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyComponent.java b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyComponent.java new file mode 100644 index 00000000..cec10c7c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyComponent.java @@ -0,0 +1,71 @@ +package com.wansensoft.erp.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "materialProperty_component") +@MaterialPropertyResource +public class MaterialPropertyComponent implements ICommonQuery { + + @Resource + private 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 materialPropertyService.checkIsNameExist(id, name); + } + +} diff --git a/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyResource.java b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyResource.java new file mode 100644 index 00000000..0a979ec3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.materialProperty; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "materialProperty") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialPropertyResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyService.java b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyService.java new file mode 100644 index 00000000..b64135a6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/materialProperty/MaterialPropertyService.java @@ -0,0 +1,148 @@ +package com.wansensoft.erp.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.MaterialProperty; +import com.wansensoft.erp.datasource.entities.MaterialPropertyExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.MaterialPropertyMapper; +import com.wansensoft.erp.datasource.mappers.MaterialPropertyMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialPropertyService { + private Logger logger = LoggerFactory.getLogger(MaterialPropertyService.class); + + @Resource + private MaterialPropertyMapper materialPropertyMapper; + + @Resource + private MaterialPropertyMapperEx materialPropertyMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + + public MaterialProperty getMaterialProperty(long id)throws Exception { + MaterialProperty result=null; + try{ + result=materialPropertyMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialProperty()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialProperty.getNativeName()).toString(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialProperty(JSONObject obj, HttpServletRequest request)throws Exception { + 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("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialProperty.getNativeName()).toString(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialProperty(Long id, HttpServletRequest request)throws Exception { + return batchDeleteMaterialPropertyByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialProperty(String ids, HttpServletRequest request)throws Exception { + return batchDeleteMaterialPropertyByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialPropertyByIds(String ids) throws Exception{ + 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("商品属性", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } +} diff --git a/src/main/java/com/wansensoft/erp/service/msg/MsgComponent.java b/src/main/java/com/wansensoft/erp/service/msg/MsgComponent.java new file mode 100644 index 00000000..4ba06eca --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/msg/MsgComponent.java @@ -0,0 +1,72 @@ +package com.wansensoft.erp.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "msg_component") +@MsgResource +public class MsgComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/msg/MsgResource.java b/src/main/java/com/wansensoft/erp/service/msg/MsgResource.java new file mode 100644 index 00000000..2f580a2c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/msg/MsgResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.msg; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2019-9-7 22:52:35 + */ +@ResourceInfo(value = "msg") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MsgResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/msg/MsgService.java b/src/main/java/com/wansensoft/erp/service/msg/MsgService.java new file mode 100644 index 00000000..2380fd63 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/msg/MsgService.java @@ -0,0 +1,335 @@ +package com.wansensoft.erp.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.Msg; +import com.wansensoft.erp.datasource.entities.MsgEx; +import com.wansensoft.erp.datasource.entities.MsgExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.MsgMapper; +import com.wansensoft.erp.datasource.mappers.MsgMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static com.wansensoft.erp.utils.Tools.getCenternTime; + +@Service +public class MsgService { + private Logger logger = LoggerFactory.getLogger(MsgService.class); + @Resource + private MsgMapper msgMapper; + + @Resource + private MsgMapperEx msgMapperEx; + + @Resource + private DepotHeadService depotHeadService; + + @Resource + private UserService userService; + + @Resource + private LogService logService; + + public Msg getMsg(long id)throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + 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("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(msg.getMsgTitle()).toString(), 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) throws Exception{ + Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); + int result=0; + try{ + result=msgMapper.updateByPrimaryKeySelective(msg); + logService.insertLog("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(msg.getMsgTitle()).toString(), 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)throws Exception { + int result=0; + try{ + result=msgMapper.deleteByPrimaryKey(id); + logService.insertLog("消息", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), 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) throws Exception{ + 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)throws Exception { + 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(); + } + + /** + * create by: qiankunpingtai + * 逻辑删除角色信息 + * create time: 2019/3/28 15:44 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMsgByIds(String ids) throws Exception{ + logService.insertLog("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((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)throws Exception { + 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) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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() throws Exception{ + 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/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelComponent.java b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelComponent.java new file mode 100644 index 00000000..58bf007b --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelComponent.java @@ -0,0 +1,65 @@ +package com.wansensoft.erp.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/11 18:10 + */ +@Service(value = "orgaUserRel_component") +@OrgaUserRelResource +public class OrgaUserRelComponent implements ICommonQuery { + @Resource + private 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/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelResource.java b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelResource.java new file mode 100644 index 00000000..94001fd0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelResource.java @@ -0,0 +1,19 @@ +package com.wansensoft.erp.service.orgaUserRel; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * 机构用户关系 + * @Author: cjl + * @Date: 2019/3/11 18:11 + */ +@ResourceInfo(value = "orgaUserRel") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrgaUserRelResource { + +} diff --git a/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelService.java b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelService.java new file mode 100644 index 00000000..d1460a8d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/orgaUserRel/OrgaUserRelService.java @@ -0,0 +1,243 @@ +package com.wansensoft.erp.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.OrgaUserRel; +import com.wansensoft.erp.datasource.entities.OrgaUserRelExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.OrgaUserRelMapper; +import com.wansensoft.erp.datasource.mappers.OrgaUserRelMapperEx; +import com.wansensoft.erp.datasource.mappers.UserMapper; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.organization.OrganizationService; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/11 18:11 + */ +@Service +public class OrgaUserRelService { + private Logger logger = LoggerFactory.getLogger(OrganizationService.class); + + @Resource + private OrgaUserRelMapper orgaUserRelMapper; + @Resource + private OrgaUserRelMapperEx orgaUserRelMapperEx; +// @Resource +// private UserMapper userMapper; + @Resource + private RedisService redisService; + @Resource + private OrganizationService organizationService; + @Resource + private LogService logService; + + public OrgaUserRel getOrgaUserRel(long id) throws Exception{ + return orgaUserRelMapper.selectByPrimaryKey(id); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertOrgaUserRel(JSONObject obj, HttpServletRequest request) throws Exception{ + 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) throws Exception{ + OrgaUserRel orgaUserRel = JSONObject.parseObject(obj.toJSONString(), OrgaUserRel.class); + int result=0; + try{ + result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel); + logService.insertLog("用户与机构关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(orgaUserRel.getId()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrgaUserRel(Long id, HttpServletRequest request)throws Exception { + int result=0; + try{ + result=orgaUserRelMapper.deleteByPrimaryKey(id); + logService.insertLog("用户与机构关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrgaUserRel(String ids, HttpServletRequest request)throws Exception { + 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; + } + /** + * create by: cjl + * description: + * 新增机构用户关联关系,反显id + * create time: 2019/3/12 9:40 + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel addOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ + Date date = new Date(); + User userInfo = 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; + } + + public User getCurrentUser()throws Exception{ + HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + return getUser(userId); + } + + public User getUser(long id)throws Exception { + User result=null; + try{ + // result=userMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + /** + * create by: cjl + * description: + * 更新机构用户关联关系 + * create time: 2019/3/12 9:40 + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel updateOrgaUserRel(OrgaUserRel orgaUserRel) throws Exception{ + User userInfo=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) throws Exception{ + String users = ""; + OrgaUserRelExample example = new OrgaUserRelExample(); + example.createCriteria().andUserIdEqualTo(userId); + List list = orgaUserRelMapper.selectByExample(example); + if(list!=null && list.size()>0) { + OrgaUserRel our = list.get(0); + List userIdList = getUserIdListByOrgId(our.getOrgaId()); + for(Long u: userIdList){ + users = users + u + ","; + } + if(users.length()>0){ + 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.size()>0) { + 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.size()>0) { + for(OrgaUserRel our: list) { + userIdList.add(our.getUserId()); + } + } + return userIdList; + } +} diff --git a/src/main/java/com/wansensoft/erp/service/organization/OrganizationComponent.java b/src/main/java/com/wansensoft/erp/service/organization/OrganizationComponent.java new file mode 100644 index 00000000..b96f94bb --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/organization/OrganizationComponent.java @@ -0,0 +1,65 @@ +package com.wansensoft.erp.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:09 + */ +@Service(value = "organization_component") +@OrganizationResource +public class OrganizationComponent implements ICommonQuery { + @Resource + private 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/src/main/java/com/wansensoft/erp/service/organization/OrganizationResource.java b/src/main/java/com/wansensoft/erp/service/organization/OrganizationResource.java new file mode 100644 index 00000000..e22e85ba --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/organization/OrganizationResource.java @@ -0,0 +1,18 @@ +package com.wansensoft.erp.service.organization; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * 机构 + * @Author: cjl + * @Date: 2019/3/6 15:10 + */ +@ResourceInfo(value = "organization") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrganizationResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/organization/OrganizationService.java b/src/main/java/com/wansensoft/erp/service/organization/OrganizationService.java new file mode 100644 index 00000000..c4786ae7 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/organization/OrganizationService.java @@ -0,0 +1,324 @@ +package com.wansensoft.erp.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.Organization; +import com.wansensoft.erp.datasource.entities.OrganizationExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.OrganizationMapper; +import com.wansensoft.erp.datasource.mappers.OrganizationMapperEx; +import com.wansensoft.erp.datasource.vo.TreeNode; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/6 15:10 + */ +@Service +public class OrganizationService { + private Logger logger = LoggerFactory.getLogger(OrganizationService.class); + + @Resource + private OrganizationMapper organizationMapper; + @Resource + private OrganizationMapperEx organizationMapperEx; +// @Resource +// private UserService userService; + @Resource + private LogService logService; + + public Organization getOrganization(long id) throws Exception { + return organizationMapper.selectByPrimaryKey(id); + } + + public List getOrganizationListByIds(String ids)throws Exception { + 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)throws Exception { + 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("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(organization.getOrgAbr()).toString(),request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateOrganization(JSONObject obj, HttpServletRequest request)throws Exception { + Organization organization = JSONObject.parseObject(obj.toJSONString(), Organization.class); + organization.setUpdateTime(new Date()); + int result=0; + try{ + result=organizationMapper.updateByPrimaryKeySelective(organization); + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(organization.getOrgAbr()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrganization(Long id, HttpServletRequest request)throws Exception { + return batchDeleteOrganizationByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganization(String ids, HttpServletRequest request)throws Exception { + return batchDeleteOrganizationByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganizationByIds(String ids) throws Exception{ + 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.size()>0) { + //如果存在子机构则不能删除 + 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)throws Exception { + 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) throws Exception{ + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(org.getOrgAbr()).toString(), + ((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)throws Exception { + logService.insertLog("机构", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getOrgAbr()).toString(), + ((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)throws Exception { + List list=null; + try{ + list=organizationMapperEx.getNodeTree(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findById(Long id) throws Exception{ + 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)throws Exception { + 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)throws Exception { + 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; + } + /** + * create by: cjl + * description: + * 检查机构编号是否已经存在 + * create time: 2019/3/7 10:01 + * @Param: orgNo + * @return void + */ + public void checkOrgNoIsExists(String orgNo,Long id)throws Exception { + 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.size()>0) { + 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.size()>0) { + for(Organization o: orgList) { + idList.add(o.getId()); + getOrgIdByParentNo(idList, o.getId()); + } + } + } +} diff --git a/src/main/java/com/wansensoft/erp/service/person/PersonComponent.java b/src/main/java/com/wansensoft/erp/service/person/PersonComponent.java new file mode 100644 index 00000000..32364af3 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/person/PersonComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "person_component") +@PersonResource +public class PersonComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/person/PersonResource.java b/src/main/java/com/wansensoft/erp/service/person/PersonResource.java new file mode 100644 index 00000000..46750962 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/person/PersonResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.person; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "person") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PersonResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/person/PersonService.java b/src/main/java/com/wansensoft/erp/service/person/PersonService.java new file mode 100644 index 00000000..236b355a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/person/PersonService.java @@ -0,0 +1,255 @@ +package com.wansensoft.erp.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.AccountHead; +import com.wansensoft.erp.datasource.entities.DepotHead; +import com.wansensoft.erp.datasource.entities.Person; +import com.wansensoft.erp.datasource.entities.PersonExample; +import com.wansensoft.erp.datasource.mappers.AccountHeadMapperEx; +import com.wansensoft.erp.datasource.mappers.DepotHeadMapperEx; +import com.wansensoft.erp.datasource.mappers.PersonMapper; +import com.wansensoft.erp.datasource.mappers.PersonMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class PersonService { + private Logger logger = LoggerFactory.getLogger(PersonService.class); + + @Resource + private PersonMapper personMapper; + + @Resource + private PersonMapperEx personMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + + public Person getPerson(long id)throws Exception { + Person result=null; + try{ + result=personMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getPersonListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + person.setEnabled(true); + result=personMapper.insertSelective(person); + logService.insertLog("经手人", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(person.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updatePerson(JSONObject obj, HttpServletRequest request)throws Exception { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + result=personMapper.updateByPrimaryKeySelective(person); + logService.insertLog("经手人", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(person.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deletePerson(Long id, HttpServletRequest request)throws Exception { + return batchDeletePersonByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePerson(String ids, HttpServletRequest request) throws Exception{ + return batchDeletePersonByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePersonByIds(String ids)throws Exception { + 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.size()>0){ + 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.size()>0){ + 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) throws Exception{ + 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() throws Exception { + 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)throws Exception { + List ids = StringUtil.strToLongList(personIds); + StringBuffer sb = new StringBuffer(); + for(Long id: ids){ + sb.append(personMap.get(id) + " "); + } + return sb.toString(); + } + + public List getPersonByType(String type)throws Exception { + 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)throws Exception { + logService.insertLog("经手人", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigComponent.java b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigComponent.java new file mode 100644 index 00000000..385fcf21 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigComponent.java @@ -0,0 +1,70 @@ +package com.wansensoft.erp.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "platformConfig_component") +@PlatformConfigResource +public class PlatformConfigComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigResource.java b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigResource.java new file mode 100644 index 00000000..37ab5fec --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.platformConfig; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2020-10-16 22:26:27 + */ +@ResourceInfo(value = "platformConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PlatformConfigResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigService.java b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigService.java new file mode 100644 index 00000000..66cf424d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/platformConfig/PlatformConfigService.java @@ -0,0 +1,196 @@ +package com.wansensoft.erp.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.PlatformConfig; +import com.wansensoft.erp.datasource.entities.PlatformConfigExample; +import com.wansensoft.erp.datasource.mappers.PlatformConfigMapper; +import com.wansensoft.erp.datasource.mappers.PlatformConfigMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +@Service +public class PlatformConfigService { + private Logger logger = LoggerFactory.getLogger(PlatformConfigService.class); + + @Resource + private UserService userService; + + @Resource + private PlatformConfigMapper platformConfigMapper; + + @Resource + private PlatformConfigMapperEx platformConfigMapperEx; + + public PlatformConfig getPlatformConfig(long id)throws Exception { + PlatformConfig result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.selectByPrimaryKey(id); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getPlatformConfig()throws Exception { + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria(); + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + list = platformConfigMapper.selectByExample(example); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String platformKey, int offset, int rows)throws Exception { + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + list = platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countPlatformConfig(String platformKey)throws Exception { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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) throws Exception{ + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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) throws Exception{ + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + List idList = StringUtil.strToLongList(ids); + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.deleteByExample(example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int updatePlatformConfigByKey(String platformKey, String platformValue)throws Exception { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + 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=platformConfigMapper.selectByExample(example); + if(list!=null && list.size()>0){ + platformConfig = list.get(0); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return platformConfig; + } + + /** + * 根据key查询平台信息-内部专用方法 + * @param platformKey + * @return + * @throws Exception + */ + public PlatformConfig getPlatformConfigByKey(String platformKey)throws Exception { + PlatformConfig platformConfig = new PlatformConfig(); + try{ + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + List list=platformConfigMapper.selectByExample(example); + if(list!=null && list.size()>0){ + platformConfig = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return platformConfig; + } +} diff --git a/src/main/java/com/wansensoft/erp/service/redis/RedisService.java b/src/main/java/com/wansensoft/erp/service/redis/RedisService.java new file mode 100644 index 00000000..561b7a0a --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/redis/RedisService.java @@ -0,0 +1,116 @@ +package com.wansensoft.erp.service.redis; + +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import org.springframework.stereotype.Component; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * Description + * + * @author jisheng hua + * @Date: 2021/1/28 18:10 + */ +@Component +public class RedisService { + + @Resource + public RedisTemplate redisTemplate; + + public static final String ACCESS_TOKEN = "X-Access-Token"; + + @Autowired(required = false) + public void setRedisTemplate(RedisTemplate redisTemplate) { + RedisSerializer stringSerializer = new StringRedisSerializer(); + redisTemplate.setKeySerializer(stringSerializer); + redisTemplate.setValueSerializer(stringSerializer); + redisTemplate.setHashKeySerializer(stringSerializer); + redisTemplate.setHashValueSerializer(stringSerializer); + this.redisTemplate = redisTemplate; + } + + /** + * @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/src/main/java/com/wansensoft/erp/service/role/RoleComponent.java b/src/main/java/com/wansensoft/erp/service/role/RoleComponent.java new file mode 100644 index 00000000..6804a045 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/role/RoleComponent.java @@ -0,0 +1,72 @@ +package com.wansensoft.erp.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "role_component") +@RoleResource +public class RoleComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/role/RoleResource.java b/src/main/java/com/wansensoft/erp/service/role/RoleResource.java new file mode 100644 index 00000000..9faa6708 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/role/RoleResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.role; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "role") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface RoleResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/role/RoleService.java b/src/main/java/com/wansensoft/erp/service/role/RoleService.java new file mode 100644 index 00000000..fc91c269 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/role/RoleService.java @@ -0,0 +1,297 @@ +package com.wansensoft.erp.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.Role; +import com.wansensoft.erp.datasource.entities.RoleEx; +import com.wansensoft.erp.datasource.entities.RoleExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.RoleMapper; +import com.wansensoft.erp.datasource.mappers.RoleMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class RoleService { + private Logger logger = LoggerFactory.getLogger(RoleService.class); + @Resource + private RoleMapper roleMapper; + + @Resource + private RoleMapperEx roleMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + + public Role getRole(long id)throws Exception { + Role result=null; + try{ + result=roleMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getRoleListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + 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)throws Exception { + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + role.setEnabled(true); + result=roleMapper.insertSelective(role); + logService.insertLog("角色", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(role.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateRole(JSONObject obj, HttpServletRequest request) throws Exception{ + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + result=roleMapper.updateByPrimaryKeySelective(role); + logService.insertLog("角色", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(role.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteRole(Long id, HttpServletRequest request)throws Exception { + return batchDeleteRoleByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRole(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteRoleByIds(ids); + } + + public int checkIsNameExist(Long id, String name) throws Exception{ + 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()throws Exception{ + 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; + } + /** + * create by: qiankunpingtai + * 逻辑删除角色信息 + * create time: 2019/3/28 15:44 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRoleByIds(String ids) throws Exception{ + 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)throws Exception { + logService.insertLog("角色", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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) throws Exception { + 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) throws Exception { + 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) throws Exception { + 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) throws Exception { + Long userId = userService.getUserId(request); + return userService.getRoleTypeByUserId(userId).getPriceLimit(); + } +} diff --git a/src/main/java/com/wansensoft/erp/service/sequence/SequenceComponent.java b/src/main/java/com/wansensoft/erp/service/sequence/SequenceComponent.java new file mode 100644 index 00000000..4d45269d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/sequence/SequenceComponent.java @@ -0,0 +1,74 @@ +package com.wansensoft.erp.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + * + * @Author: jishenghua + * @Date: 2021/3/16 16:33 + */ +@Service(value = "sequence_component") +@SequenceResource +public class SequenceComponent implements ICommonQuery { + @Resource + private 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/src/main/java/com/wansensoft/erp/service/sequence/SequenceResource.java b/src/main/java/com/wansensoft/erp/service/sequence/SequenceResource.java new file mode 100644 index 00000000..64384abf --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/sequence/SequenceResource.java @@ -0,0 +1,18 @@ +package com.wansensoft.erp.service.sequence; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * + * @Author: jishenghua + * @Date: 2021/3/16 16:33 + */ +@ResourceInfo(value = "sequence") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SequenceResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/sequence/SequenceService.java b/src/main/java/com/wansensoft/erp/service/sequence/SequenceService.java new file mode 100644 index 00000000..06e6242e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/sequence/SequenceService.java @@ -0,0 +1,92 @@ +package com.wansensoft.erp.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.SerialNumber; +import com.wansensoft.erp.datasource.entities.SerialNumberEx; +import com.wansensoft.erp.datasource.mappers.SequenceMapperEx; +import com.wansensoft.erp.exception.JshException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * Description + * + * @Author: jishenghua + * @Date: 2021/3/16 16:33 + */ +@Service +public class SequenceService { + private Logger logger = LoggerFactory.getLogger(SequenceService.class); + + @Resource + private SequenceMapperEx sequenceMapperEx; + + public SerialNumber getSequence(long id)throws Exception { + return null; + } + + public List select(String name, Integer offset, Integer rows)throws Exception { + return null; + } + + public Long countSequence(String name)throws Exception { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSequence(JSONObject obj, HttpServletRequest request)throws Exception { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSequence(JSONObject obj, HttpServletRequest request) throws Exception{ + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSequence(Long id, HttpServletRequest request)throws Exception { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSequence(String ids, HttpServletRequest request)throws Exception { + return 0; + } + + public int checkIsNameExist(Long id, String serialNumber)throws Exception { + return 0; + } + + /** + * 创建一个唯一的序列号 + * */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String buildOnlyNumber()throws Exception{ + 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/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberResource.java b/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberResource.java new file mode 100644 index 00000000..29991b2e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberResource.java @@ -0,0 +1,18 @@ +package com.wansensoft.erp.service.serialNumber; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + * + * @Author: jishenghua + * @Date: 2019/1/21 16:33 + */ +@ResourceInfo(value = "serialNumber") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SerialNumberResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberService.java b/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberService.java new file mode 100644 index 00000000..8d6fd275 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/serialNumber/SerialNumberService.java @@ -0,0 +1,443 @@ +package com.wansensoft.erp.service.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.material.MaterialService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.datasource.mappers.MaterialMapperEx; +import com.wansensoft.erp.datasource.mappers.SerialNumberMapper; +import com.wansensoft.erp.datasource.mappers.SerialNumberMapperEx; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/1/21 16:33 + */ +@Service +public class SerialNumberService { + private Logger logger = LoggerFactory.getLogger(SerialNumberService.class); + + @Resource + private SerialNumberMapper serialNumberMapper; + @Resource + private SerialNumberMapperEx serialNumberMapperEx; + @Resource + private MaterialMapperEx materialMapperEx; + @Resource + private MaterialService materialService; + @Resource + private UserService userService; + @Resource + private LogService logService; + + + public SerialNumber getSerialNumber(long id)throws Exception { + SerialNumber result=null; + try{ + result=serialNumberMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSerialNumberListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + return null; + + } + + public Long countSerialNumber(String serialNumber,String materialName)throws Exception { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSerialNumber(JSONObject obj, HttpServletRequest request)throws Exception { + 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) throws Exception{ + 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("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(), + ((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)throws Exception { + return batchDeleteSerialNumberByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumber(String ids, HttpServletRequest request)throws Exception { + return batchDeleteSerialNumberByIds(ids); + } + + /** + * create by: qiankunpingtai + * 逻辑删除序列号信息 + * create time: 2019/3/27 17:43 + * @Param: ids + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumberByIds(String ids) throws Exception{ + 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)throws Exception { + 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(); + } + /** + * create by: cjl + * description: + * 根据商品名称判断商品名称是否有效 + * create time: 2019/1/23 17:04 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long checkMaterialName(String materialName)throws Exception{ + 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; + } + /** + * create by: cjl + * description: + * 根据商品名称判断给商品添加序列号是否可行 + * 1、根据商品名称必须查询到唯一的商品 + * 2、该商品必须已经启用序列号 + * 3、该商品已绑定序列号数量小于商品现有库存 + * 2019-02-01 + * 用商品的库存去限制序列号的添加有点不合乎道理,去掉此限制 + * create time: 2019/1/23 17:04 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long getSerialNumberMaterialIdByBarCode(String materialCode)throws Exception{ + if(StringUtil.isNotEmpty(materialCode)){ + //计算商品库存和目前占用的可用序列号数量关系 + //库存=入库-出库 + //入库数量 + Long materialId = 0L; + List list = materialService.getMaterialByBarCode(materialCode); + if(list!=null && list.size()>0) { + materialId = list.get(0).getId(); + } + return materialId; + } + return null; + } + + /** + * create by: cjl + * description: + * 出库时判断序列号库存是否足够, + * 同时将对应的序列号绑定单据 + * create time: 2019/1/24 16:24 + * @Param: List + * @return void + */ + public void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo,User userInfo, String snList) throws Exception{ + if(depotItem!=null){ + sellSerialNumber(depotItem.getMaterialId(), outBillNo, snList,userInfo); + } + } + /** + * + * + * */ + /** + * create by: cjl + * 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) throws Exception{ + 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; + } + + /** + * create by: cjl + * 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) throws Exception{ + 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; + } + + /** + * create by: cjl + * description: + *批量添加序列号,最多500个 + * create time: 2019/1/29 15:11 + * @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)throws Exception { + 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("序列号", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(), + ((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)throws Exception { + 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)throws Exception { + 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) throws Exception { + //录入序列号的时候不能重复 + 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/src/main/java/com/wansensoft/erp/service/supplier/SupplierComponent.java b/src/main/java/com/wansensoft/erp/service/supplier/SupplierComponent.java new file mode 100644 index 00000000..5a34635d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/supplier/SupplierComponent.java @@ -0,0 +1,78 @@ +package com.wansensoft.erp.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "supplier_component") +@SupplierResource +public class SupplierComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/supplier/SupplierResource.java b/src/main/java/com/wansensoft/erp/service/supplier/SupplierResource.java new file mode 100644 index 00000000..4363067e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/supplier/SupplierResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.supplier; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "supplier") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SupplierResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/supplier/SupplierService.java b/src/main/java/com/wansensoft/erp/service/supplier/SupplierService.java new file mode 100644 index 00000000..ffd1f184 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/supplier/SupplierService.java @@ -0,0 +1,650 @@ +package com.wansensoft.erp.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.datasource.mappers.*; +import com.wansensoft.erp.datasource.vo.DepotHeadVo4StatementAccount; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.accountHead.AccountHeadService; +import com.wansensoft.erp.service.depotHead.DepotHeadService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.systemConfig.SystemConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.BaseResponseInfo; +import com.wansensoft.erp.utils.ExcelUtils; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.utils.Tools; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + + +@Service +public class SupplierService { + private Logger logger = LoggerFactory.getLogger(SupplierService.class); + + @Resource + private SupplierMapper supplierMapper; + + @Resource + private SupplierMapperEx supplierMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + @Resource + private AccountHeadMapperEx accountHeadMapperEx; + @Resource + private DepotHeadMapperEx depotHeadMapperEx; + @Resource + private AccountItemMapperEx accountItemMapperEx; + @Resource + private DepotHeadService depotHeadService; + @Resource + private AccountHeadService accountHeadService; + @Resource + private SystemConfigService systemConfigService; + @Resource + private UserBusinessService userBusinessService; + + public Supplier getSupplier(long id)throws Exception { + Supplier result=null; + try{ + result=supplierMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSupplierListByIds(String ids)throws Exception { + 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()throws Exception { + 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) throws Exception{ + 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) throws Exception{ + 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)throws Exception { + 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.size() == 0) { + 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("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(supplier.getSupplier()).toString(),request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSupplier(JSONObject obj, HttpServletRequest request)throws Exception { + 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("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplier.getSupplier()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSupplier(Long id, HttpServletRequest request)throws Exception { + return batchDeleteSupplierByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplier(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteSupplierByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplierByIds(String ids)throws Exception { + 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.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); + } + //校验单据主表 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)throws Exception { + 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)throws Exception { + 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)throws Exception{ + 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()throws Exception { + 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()throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + logService.insertLog("商家", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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()throws Exception{ + 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) throws Exception{ + 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) throws Exception { + 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) throws Exception{ + String type = "供应商"; + 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); + } + + public void importCustomer(MultipartFile file, HttpServletRequest request) throws Exception{ + String type = "客户"; + 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); + } + + public void importMember(MultipartFile file, HttpServletRequest request) throws Exception{ + String type = "会员"; + 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); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BaseResponseInfo importExcel(List mList, String type) throws Exception { + logService.insertLog(type, + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(), + ((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) { + e.printStackTrace(); + info.code = 500; + data.put("message", e.getMessage()); + } + info.data = data; + return info; + } + + public BigDecimal parseBigDecimalEx(String str)throws Exception{ + if(!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + public File exportExcel(List dataList, String type) throws Exception { + 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) throws Exception { + 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/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigComponent.java b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigComponent.java new file mode 100644 index 00000000..15c154c6 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigComponent.java @@ -0,0 +1,71 @@ +package com.wansensoft.erp.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "systemConfig_component") +@SystemConfigResource +public class SystemConfigComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigResource.java b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigResource.java new file mode 100644 index 00000000..e957cc81 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.systemConfig; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "systemConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SystemConfigResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigService.java b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigService.java new file mode 100644 index 00000000..92efb4a9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/systemConfig/SystemConfigService.java @@ -0,0 +1,466 @@ +package com.wansensoft.erp.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.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.SystemConfig; +import com.wansensoft.erp.datasource.entities.SystemConfigExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.SystemConfigMapper; +import com.wansensoft.erp.datasource.mappers.SystemConfigMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.platformConfig.PlatformConfigService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.FileUtils; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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 jakarta.annotation.Resource; +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 SystemConfigService { + private Logger logger = LoggerFactory.getLogger(SystemConfigService.class); + + @Resource + private SystemConfigMapper systemConfigMapper; + @Resource + private SystemConfigMapperEx systemConfigMapperEx; + @Resource + private PlatformConfigService platformConfigService; + @Resource + private UserService userService; + @Resource + private LogService logService; + + @Value(value="${file.path}") + private String filePath; + + public SystemConfig getSystemConfig(long id)throws Exception { + SystemConfig result=null; + try{ + result=systemConfigMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSystemConfig()throws Exception { + 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)throws Exception { + List list=null; + try{ + list=systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countSystemConfig(String companyName)throws Exception { + 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) throws Exception{ + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + result=systemConfigMapper.insertSelective(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(systemConfig.getCompanyName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{ + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + result = systemConfigMapper.updateByPrimaryKeySelective(systemConfig); + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(systemConfig.getCompanyName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSystemConfig(Long id, HttpServletRequest request)throws Exception { + return batchDeleteSystemConfigByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfig(String ids, HttpServletRequest request)throws Exception { + return batchDeleteSystemConfigByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfigByIds(String ids)throws Exception { + logService.insertLog("系统配置", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.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) throws Exception{ + 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) throws Exception { + 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) throws Exception { + 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; + // 如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。 + byte [] byteArr = mf.getBytes(); + + // 创建OSSClient实例。 + OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); + + try { + // 保存原文件 + 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()); + } finally { + if (ossClient != null) { + ossClient.shutdown(); + } + } + return ""; + } + + public String getFileUrlLocal(String imgPath) { + return filePath + File.separator + imgPath; + } + + public String getFileUrlAliOss(String imgPath) throws Exception { + String linkUrl = platformConfigService.getPlatformConfigByKey("aliOss_linkUrl").getPlatformValue(); + return linkUrl + filePath + "/" + imgPath; + } + + public BufferedImage getImageMini(InputStream inputStream, int w) throws Exception { + 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; + } + + /** + * 获取仓库开关 + * @return + * @throws Exception + */ + public boolean getDepotFlag() throws Exception { + boolean depotFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getDepotFlag(); + if(("1").equals(flag)) { + depotFlag = true; + } + } + return depotFlag; + } + + /** + * 获取客户开关 + * @return + * @throws Exception + */ + public boolean getCustomerFlag() throws Exception { + boolean customerFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getCustomerFlag(); + if(("1").equals(flag)) { + customerFlag = true; + } + } + return customerFlag; + } + + /** + * 获取负库存开关 + * @return + * @throws Exception + */ + public boolean getMinusStockFlag() throws Exception { + boolean minusStockFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getMinusStockFlag(); + if(("1").equals(flag)) { + minusStockFlag = true; + } + } + return minusStockFlag; + } + + /** + * 获取更新单价开关 + * @return + * @throws Exception + */ + public boolean getUpdateUnitPriceFlag() throws Exception { + boolean updateUnitPriceFlag = true; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getUpdateUnitPriceFlag(); + if(("0").equals(flag)) { + updateUnitPriceFlag = false; + } + } + return updateUnitPriceFlag; + } + + /** + * 获取超出关联单据开关 + * @return + * @throws Exception + */ + public boolean getOverLinkBillFlag() throws Exception { + boolean overLinkBillFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getOverLinkBillFlag(); + if(("1").equals(flag)) { + overLinkBillFlag = true; + } + } + return overLinkBillFlag; + } + + /** + * 获取强审核开关 + * @return + * @throws Exception + */ + public boolean getForceApprovalFlag() throws Exception { + 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() throws Exception { + 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/src/main/java/com/wansensoft/erp/service/tenant/TenantComponent.java b/src/main/java/com/wansensoft/erp/service/tenant/TenantComponent.java new file mode 100644 index 00000000..006a6cec --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/tenant/TenantComponent.java @@ -0,0 +1,76 @@ +package com.wansensoft.erp.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "tenant_component") +@TenantResource +public class TenantComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/tenant/TenantResource.java b/src/main/java/com/wansensoft/erp/service/tenant/TenantResource.java new file mode 100644 index 00000000..1612333d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/tenant/TenantResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.tenant; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2019-6-27 22:56:56 + */ +@ResourceInfo(value = "tenant") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface TenantResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/tenant/TenantService.java b/src/main/java/com/wansensoft/erp/service/tenant/TenantService.java new file mode 100644 index 00000000..564b2df9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/tenant/TenantService.java @@ -0,0 +1,218 @@ +package com.wansensoft.erp.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.entities.Tenant; +import com.wansensoft.erp.datasource.entities.TenantEx; +import com.wansensoft.erp.datasource.entities.TenantExample; +import com.wansensoft.erp.datasource.mappers.TenantMapper; +import com.wansensoft.erp.datasource.mappers.TenantMapperEx; +import com.wansensoft.erp.datasource.mappers.UserMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class TenantService { + private Logger logger = LoggerFactory.getLogger(TenantService.class); + + @Resource + private TenantMapper tenantMapper; + + @Resource + private TenantMapperEx tenantMapperEx; + + @Resource + private UserMapperEx userMapperEx; + + @Resource + private UserService userService; + + @Resource + private LogService logService; + + @Value("${tenant.userNumLimit}") + private Integer userNumLimit; + + @Value("${tenant.tryDayLimit}") + private Integer tryDayLimit; + + public Tenant getTenant(long id)throws Exception { + Tenant result=null; + try{ + result=tenantMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getTenant()throws Exception { + TenantExample example = new TenantExample(); + List list=null; + try{ + list=tenantMapper.selectByExample(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)throws Exception { + List list= new ArrayList<>(); + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + 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)throws Exception { + Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.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)throws Exception { + List idList = StringUtil.strToLongList(ids); + TenantExample example = new TenantExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = tenantMapper.deleteByExample(example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name)throws Exception { + TenantExample example = new TenantExample(); + example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name); + List list=null; + try{ + list= tenantMapper.selectByExample(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.selectByExample(example); + if(list.size()>0) { + tenant = list.get(0); + } + return tenant; + } + + public int batchSetStatus(Boolean status, String ids)throws Exception { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + String statusStr = ""; + if (status) { + statusStr = "批量启用"; + } else { + statusStr = "批量禁用"; + } + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ids).append("-").append(statusStr).toString(), + ((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/src/main/java/com/wansensoft/erp/service/unit/UnitComponent.java b/src/main/java/com/wansensoft/erp/service/unit/UnitComponent.java new file mode 100644 index 00000000..587e0481 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/unit/UnitComponent.java @@ -0,0 +1,71 @@ +package com.wansensoft.erp.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "unit_component") +@UnitResource +public class UnitComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/unit/UnitResource.java b/src/main/java/com/wansensoft/erp/service/unit/UnitResource.java new file mode 100644 index 00000000..0dbc4965 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/unit/UnitResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.unit; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "unit") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UnitResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/unit/UnitService.java b/src/main/java/com/wansensoft/erp/service/unit/UnitService.java new file mode 100644 index 00000000..ae682644 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/unit/UnitService.java @@ -0,0 +1,270 @@ +package com.wansensoft.erp.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.entities.Material; +import com.wansensoft.erp.datasource.entities.Unit; +import com.wansensoft.erp.datasource.entities.UnitExample; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.mappers.MaterialMapperEx; +import com.wansensoft.erp.datasource.mappers.UnitMapper; +import com.wansensoft.erp.datasource.mappers.UnitMapperEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class UnitService { + private Logger logger = LoggerFactory.getLogger(UnitService.class); + + @Resource + private UnitMapper unitMapper; + + @Resource + private UnitMapperEx unitMapperEx; + @Resource + private UserService userService; + @Resource + private LogService logService; + @Resource + private MaterialMapperEx materialMapperEx; + + public Unit getUnit(long id)throws Exception { + Unit result=null; + try{ + result=unitMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUnitListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + List list=null; + try{ + list=unitMapperEx.selectByConditionUnit(name, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countUnit(String name)throws Exception { + 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)throws Exception { + Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class); + int result=0; + try{ + parseNameByUnit(unit); + unit.setEnabled(true); + result=unitMapper.insertSelective(unit); + logService.insertLog("计量单位", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(unit.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUnit(JSONObject obj, HttpServletRequest request)throws Exception { + 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("计量单位", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(unit.getName()).toString(), 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)throws Exception { + return batchDeleteUnitByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnit(String ids, HttpServletRequest request) throws Exception{ + return batchDeleteUnitByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnitByIds(String ids)throws Exception { + 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.size()>0){ + 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)throws Exception { + 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.size()>0) { + 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)throws Exception { + logService.insertLog("计量单位", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ENABLED).toString(), + ((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/src/main/java/com/wansensoft/erp/service/user/UserComponent.java b/src/main/java/com/wansensoft/erp/service/user/UserComponent.java new file mode 100644 index 00000000..0f33f9ec --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/user/UserComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.erp.service.user; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.service.ICommonQuery; +import com.wansensoft.erp.utils.Constants; +import com.wansensoft.erp.utils.QueryUtils; +import com.wansensoft.erp.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service(value = "user_component") +@UserResource +public class UserComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/user/UserResource.java b/src/main/java/com/wansensoft/erp/service/user/UserResource.java new file mode 100644 index 00000000..c63ec6ea --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/user/UserResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.user; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "user") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/user/UserService.java b/src/main/java/com/wansensoft/erp/service/user/UserService.java new file mode 100644 index 00000000..3b48e7e5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/user/UserService.java @@ -0,0 +1,920 @@ +package com.wansensoft.erp.service.user; + +import com.wansensoft.erp.datasource.entities.*; +import com.wansensoft.erp.exception.BusinessParamCheckingException; +import com.wansensoft.erp.service.functions.FunctionService; +import com.wansensoft.erp.service.platformConfig.PlatformConfigService; +import com.wansensoft.erp.service.redis.RedisService; +import com.wansensoft.erp.service.role.RoleService; +import com.wansensoft.erp.utils.HttpClient; +import com.wansensoft.erp.service.tenant.TenantService; +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.constants.ExceptionConstants; +import com.wansensoft.erp.datasource.mappers.UserMapper; +import com.wansensoft.erp.datasource.mappers.UserMapperEx; +import com.wansensoft.erp.datasource.vo.TreeNodeEx; +import com.wansensoft.erp.exception.BusinessRunTimeException; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.erp.service.userBusiness.UserBusinessService; +import com.wansensoft.erp.utils.ExceptionCodeConstants; +import com.wansensoft.erp.utils.StringUtil; +import com.wansensoft.erp.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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +@Service +public class UserService { + private Logger logger = LoggerFactory.getLogger(UserService.class); + + @Resource + private UserMapper userMapper; + + @Resource + private UserMapperEx userMapperEx; + @Resource + private OrgaUserRelService orgaUserRelService; + @Resource + private LogService logService; + @Resource + private TenantService tenantService; + @Resource + private UserBusinessService userBusinessService; + @Resource + private RoleService roleService; + @Resource + private FunctionService functionService; + @Resource + private PlatformConfigService platformConfigService; + @Resource + private RedisService redisService; + + public User getUser(long id)throws Exception { + User result=null; + try{ + result=userMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUserListByIds(String ids)throws Exception { + 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()throws Exception { + 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)throws Exception { + 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)throws Exception { + Long result=null; + try{ + result=userMapperEx.countsByUser(userName, loginName); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:30 + * @Param: beanJson +  * @Param: request + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUser(JSONObject obj, HttpServletRequest request)throws Exception { + 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("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(user.getLoginName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:31 + * @Param: beanJson +  * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUser(JSONObject obj, HttpServletRequest request) throws Exception{ + User user = JSONObject.parseObject(obj.toJSONString(), User.class); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getLoginName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:32 + * @Param: user + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUserByObj(User user) throws Exception{ + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * create by: cjl + * description: + * 添加事务控制 + * create time: 2019/1/11 14:33 + * @Param: md5Pwd +  * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int resetPwd(String md5Pwd, Long id) throws Exception{ + int result=0; + logService.insertLog("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), + ((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)throws Exception { + return batDeleteUser(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUser(String ids, HttpServletRequest request)throws Exception { + return batDeleteUser(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batDeleteUser(String ids) throws Exception{ + 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) throws Exception { + 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(), "用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getLoginName()).toString(), + ((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.size() == 0) { + 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)throws Exception { + 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)throws Exception { + 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(); + } + /** + * create by: cjl + * description: + * 获取当前用户信息 + * create time: 2019/1/24 10:01 + * @Param: + * @return com.jsh.erp.datasource.entities.User + */ + public User getCurrentUser()throws Exception{ + 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) throws Exception{ + 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) throws Exception{ + /** + * 新增用户默认设置 + * 1、密码默认123456 + * 2是否系统自带默认为非系统自带 + * 3是否管理者默认为员工 + * 4默认用户状态为正常 + * */ + ue.setPassword(Tools.md5Encryp(BusinessConstants.USER_DEFAULT_PASSWORD)); + 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); + }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) throws Exception{ + /** + * 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) throws Exception{ + 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) throws Exception{ + 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("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(), + ((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)throws Exception{ + int result =0; + try{ + result=userMapper.updateByPrimaryKeySelective(ue); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result>0){ + return ue; + } + return null; + } + /** + * 检查登录名不能重复 + * create time: 2019/3/12 11:36 + * @Param: userEx + * @return void + */ + public void checkLoginName(UserEx userEx)throws Exception{ + 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()throws Exception { + 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) throws Exception { + Role role = new Role(); + List list = userBusinessService.getBasicData(String.valueOf(userId), "UserRole"); + UserBusiness ub = null; + if(list.size() > 0) { + ub = list.get(0); + String values = ub.getValue(); + String roleId = null; + if(values!=null) { + values = values.replaceAll("\\[\\]",",").replace("[","").replace("]",""); + } + String [] valueArray=values.split(","); + if(valueArray.length>0) { + roleId = valueArray[0]; + } + role = roleService.getRoleWithoutTenant(Long.parseLong(roleId)); + } + return role; + } + + /** + * 获取用户id + * @param request + * @return + */ + public Long getUserId(HttpServletRequest request) throws Exception{ + 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) throws Exception { + JSONArray btnStrArr = new JSONArray(); + List userRoleList = userBusinessService.getBasicData(userId.toString(), "UserRole"); + if(userRoleList!=null && userRoleList.size()>0) { + String roleValue = userRoleList.get(0).getValue(); + if(StringUtil.isNotEmpty(roleValue) && roleValue.indexOf("[")>-1 && roleValue.indexOf("]")>-1){ + roleValue = roleValue.replace("[", "").replace("]", ""); //角色id-单个 + List roleFunctionsList = userBusinessService.getBasicData(roleValue, "RoleFunctions"); + if(roleFunctionsList!=null && roleFunctionsList.size()>0) { + String btnStr = roleFunctionsList.get(0).getBtnStr(); + if(StringUtil.isNotEmpty(btnStr)){ + btnStrArr = JSONArray.parseArray(btnStr); + } + } + } + } + //将数组中的funId转为url + JSONArray btnStrWithUrlArr = new JSONArray(); + if(btnStrArr.size()>0) { + 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)throws Exception { + 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("用户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userStr).append("-").append(statusStr).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } else { + result = 1; + } + return result; + } + + public User getUserByWeixinCode(String weixinCode) throws Exception { + 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) throws Exception { + 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/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessComponent.java b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessComponent.java new file mode 100644 index 00000000..5b3d7a76 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessComponent.java @@ -0,0 +1,64 @@ +package com.wansensoft.erp.service.userBusiness; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "userBusiness_component") +@UserBusinessResource +public class UserBusinessComponent implements ICommonQuery { + + @Resource + private 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/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessResource.java b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessResource.java new file mode 100644 index 00000000..4cb62ca1 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.erp.service.userBusiness; + +import com.wansensoft.erp.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +@ResourceInfo(value = "userBusiness") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserBusinessResource { +} diff --git a/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessService.java b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessService.java new file mode 100644 index 00000000..05a8c235 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/service/userBusiness/UserBusinessService.java @@ -0,0 +1,209 @@ +package com.wansensoft.erp.service.userBusiness; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.erp.constants.BusinessConstants; +import com.wansensoft.erp.datasource.mappers.UserBusinessMapper; +import com.wansensoft.erp.datasource.mappers.UserBusinessMapperEx; +import com.wansensoft.erp.exception.JshException; +import com.wansensoft.erp.service.CommonQueryManager; +import com.wansensoft.erp.service.functions.FunctionService; +import com.wansensoft.erp.service.log.LogService; +import com.wansensoft.erp.service.user.UserService; +import com.wansensoft.erp.utils.Tools; +import com.wansensoft.erp.datasource.entities.User; +import com.wansensoft.erp.datasource.entities.UserBusiness; +import com.wansensoft.erp.datasource.entities.UserBusinessExample; +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.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class UserBusinessService { + private Logger logger = LoggerFactory.getLogger(UserBusinessService.class); + + @Resource + private UserBusinessMapper userBusinessMapper; + @Resource + private UserBusinessMapperEx userBusinessMapperEx; + @Resource + private LogService logService; + @Resource + private UserService userService; + + @Resource + private FunctionService functionService; + + @Resource + private CommonQueryManager configResourceManager; + + public UserBusiness getUserBusiness(long id)throws Exception { + UserBusiness result=null; + try{ + result=userBusinessMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUserBusiness()throws Exception { + 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) throws Exception { + 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) throws Exception { + 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)throws Exception { + return batchDeleteUserBusinessByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusiness(String ids, HttpServletRequest request)throws Exception { + return batchDeleteUserBusinessByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusinessByIds(String ids) throws Exception{ + logService.insertLog("关联关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo=userService.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)throws Exception { + return 1; + } + + public List getBasicData(String keyId, String type)throws Exception{ + 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)throws Exception{ + 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) throws Exception { + String ubValue = ""; + List ubList = getBasicData(keyId, type); + if(ubList!=null && ubList.size()>0) { + ubValue = ubList.get(0).getValue(); + } + return ubValue; + } + + public Long checkIsValueExist(String type, String keyId)throws Exception { + 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.size() > 0) { + id = list.get(0).getId(); + } + return id; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateBtnStr(String keyId, String type, String btnStr) throws Exception{ + logService.insertLog("关联关系", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append("角色的按钮权限").toString(), + ((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/src/main/java/com/wansensoft/erp/utils/AnnotationUtils.java b/src/main/java/com/wansensoft/erp/utils/AnnotationUtils.java new file mode 100644 index 00000000..2c15be13 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/AnnotationUtils.java @@ -0,0 +1,28 @@ +package com.wansensoft.erp.utils; + +import java.lang.annotation.Annotation; +import java.lang.annotation.Documented; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class AnnotationUtils { + public static A getAnnotation(Class cls, Class annotationClass) { + A res = cls.getAnnotation(annotationClass); + if (res == null) { + for (Annotation annotation : cls.getAnnotations()) { + if (annotation instanceof Documented) { + break; + } + res = getAnnotation(annotation.annotationType(), annotationClass); + if (res != null) + break; + } + } + return res; + } + + public static A getAnnotation(T obj, Class annotationClass) { + return getAnnotation(obj.getClass(), annotationClass); + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/BaseResponseInfo.java b/src/main/java/com/wansensoft/erp/utils/BaseResponseInfo.java new file mode 100644 index 00000000..c26ee2db --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/BaseResponseInfo.java @@ -0,0 +1,11 @@ +package com.wansensoft.erp.utils; + +public class BaseResponseInfo { + public int code; + public Object data; + + public BaseResponseInfo() { + code = 400; + data = null; + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/ColumnPropertyUtil.java b/src/main/java/com/wansensoft/erp/utils/ColumnPropertyUtil.java new file mode 100644 index 00000000..a912e724 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ColumnPropertyUtil.java @@ -0,0 +1,65 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/ComputerInfo.java b/src/main/java/com/wansensoft/erp/utils/ComputerInfo.java new file mode 100644 index 00000000..21776b29 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ComputerInfo.java @@ -0,0 +1,155 @@ +package com.wansensoft.erp.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/* + * <取网卡物理地址-- + * 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"); + + private static final String[] windowsCommand = { "ipconfig", "/all" }; + private static final String[] linuxCommand = { "/sbin/ifconfig", "-a" }; + private static final Pattern macPattern = Pattern.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", + Pattern.CASE_INSENSITIVE); + + /** + * 获取多个网卡地址 + * + * @return + * @throws IOException + */ + private final static List getMacAddressList() throws IOException { + final ArrayList macAddressList = new ArrayList(); + final String os = System.getProperty("os.name"); + final String command[]; + + if (os.startsWith("Windows")) { + command = windowsCommand; + } else if (os.startsWith("Linux")) { + command = linuxCommand; + } else { + throw new IOException("Unknow operating system:" + os); + } + // 执行命令 + final Process process = Runtime.getRuntime().exec(command); + + BufferedReader bufReader = new BufferedReader(new InputStreamReader(process.getInputStream())); + for (String line = null; (line = bufReader.readLine()) != null;) { + Matcher matcher = macPattern.matcher(line); + if (matcher.matches()) { + macAddressList.add(matcher.group(1)); + // macAddressList.add(matcher.group(1).replaceAll("[-:]", + // ""));//去掉MAC中的“-” + } + } + + process.destroy(); + bufReader.close(); + return macAddressList; + } + + /** + * 获取一个网卡地址(多个网卡时从中获取一个) + * + * @return + */ + public static String getMacAddress() { + if (macAddressStr == null || macAddressStr.equals("")) { + StringBuffer sb = new StringBuffer(); // 存放多个网卡地址用,目前只取一个非0000000000E0隧道的值 + try { + List macList = getMacAddressList(); + for (Iterator iter = macList.iterator(); iter.hasNext();) { + String amac = iter.next(); + if (!amac.equals("0000000000E0")) { + sb.append(amac); + break; + } + } + } catch (IOException e) { + e.printStackTrace(); + } + + macAddressStr = sb.toString(); + + } + + return macAddressStr; + } + + /** + * 获取电脑名 + * + * @return + */ + public static String getComputerName() { + if (computerName == null || computerName.equals("")) { + computerName = System.getenv().get("COMPUTERNAME"); + } + return computerName; + } + + /** + * 获取客户端IP地址 + * + * @return + */ + public static String getIpAddrAndName() throws IOException { + return InetAddress.getLocalHost().toString(); + } + + /** + * 获取客户端IP地址 + * + * @return + */ + public static String getIpAddr() throws IOException { + return InetAddress.getLocalHost().getHostAddress().toString(); + } + + /** + * 获取电脑唯一标识 + * + * @return + */ + public static String getComputerID() { + String id = getMacAddress(); + if (id == null || id.equals("")) { + try { + id = getIpAddrAndName(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return computerName; + } + + /** + * 限制创建实例 + */ + private ComputerInfo() { + + } + + public static void main(String[] args) throws IOException { + System.out.println(ComputerInfo.getMacAddress()); + System.out.println(ComputerInfo.getComputerName()); + System.out.println(ComputerInfo.getIpAddr()); + System.out.println(ComputerInfo.getIpAddrAndName()); + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/Constants.java b/src/main/java/com/wansensoft/erp/utils/Constants.java new file mode 100644 index 00000000..fa9b518e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/Constants.java @@ -0,0 +1,34 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/ErpInfo.java b/src/main/java/com/wansensoft/erp/utils/ErpInfo.java new file mode 100644 index 00000000..00071309 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ErpInfo.java @@ -0,0 +1,37 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/ExcelUtils.java b/src/main/java/com/wansensoft/erp/utils/ExcelUtils.java new file mode 100644 index 00000000..9366254c --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ExcelUtils.java @@ -0,0 +1,154 @@ +package com.wansensoft.erp.utils; + +import java.io.*; +import java.util.*; + +import jxl.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; +import jxl.format.*; +import jxl.write.Label; +import jxl.write.WritableCellFormat; +import jxl.write.WritableFont; +import jxl.write.WritableSheet; +import jxl.write.WritableWorkbook; + +import jakarta.servlet.http.HttpServletResponse; + +@Slf4j +public class ExcelUtils { + + public static InputStream getPathByFileName(String template, String tmpFileName) { + File tmpFile = new File(template, tmpFileName); + InputStream path = null; + //判断文件或文件夹是否存在 + if (tmpFile.exists()) { + try { + path = new FileInputStream(tmpFile); + } catch (FileNotFoundException e) { + log.error("", e); + } + } + return path; + } + + /** + * 导出excel,不需要第一行的title + * + * @param fileName + * @param names + * @param title + * @param objects + * @return + * @throws Exception + */ + public static File exportObjectsWithoutTitle(String fileName, String tip, + String[] names, String title, List objects) + throws Exception { + File excelFile = new File(fileName); + WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); + WritableSheet sheet = wtwb.createSheet(title, 0); + sheet.getSettings().setDefaultColumnWidth(12); + + // 标题的格式-红色 + WritableFont redWF = new WritableFont(WritableFont.ARIAL, 12, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + Colour.RED); + WritableCellFormat redWFFC = new WritableCellFormat(redWF); + redWFFC.setVerticalAlignment(VerticalAlignment.CENTRE); + redWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); + + // 标题的格式-黑色 + WritableFont blackWF = new WritableFont(WritableFont.ARIAL, 12, + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, + Colour.BLACK); + WritableCellFormat blackWFFC = new WritableCellFormat(blackWF); + blackWFFC.setVerticalAlignment(VerticalAlignment.CENTRE); + blackWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); + + // 设置字体以及单元格格式 + WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 12); + WritableCellFormat format = new WritableCellFormat(wfont); + format.setAlignment(Alignment.LEFT); + format.setVerticalAlignment(VerticalAlignment.TOP); + + // 第一行写入提示 + if(StringUtil.isNotEmpty(tip) && tip.contains("*")) { + sheet.addCell(new Label(0, 0, tip, redWFFC)); + } else { + sheet.addCell(new Label(0, 0, tip, blackWFFC)); + } + + // 第二行写入标题 + for (int i = 0; i < names.length; i++) { + 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)); + } + } + + // 其余行依次写入数据 + int rowNum = 2; + for (int j = 0; j < objects.size(); j++) { + String[] obj = objects.get(j); + for (int h = 0; h < obj.length; h++) { + sheet.addCell(new Label(h, rowNum, obj[h], format)); + } + rowNum = rowNum + 1; + } + wtwb.write(); + wtwb.close(); + return excelFile; + } + + public static String getContent(Sheet src, int rowNum, int colNum) { + if(colNum < src.getRow(rowNum).length) { + return src.getRow(rowNum)[colNum].getContents().trim(); + } else { + return null; + } + } + + /** + * 获取真实的行数,剔除掉空白行 + * @param src + * @return + */ + public static int getRightRows(Sheet src) { + int rsRows = src.getRows(); //行数 + int rsCols = src.getColumns(); //列数 + int nullCellNum; + int rightRows = rsRows; + for (int i = 1; i < rsRows; i++) { //统计行中为空的单元格数 + nullCellNum = 0; + for (int j = 0; j < rsCols; j++) { + String val = src.getCell(j, i).getContents().trim(); + if (StringUtils.isEmpty(val)) { + nullCellNum++; + } + } + if (nullCellNum >= rsCols) { //如果nullCellNum大于或等于总的列数 + rightRows--; //行数减一 + } + } + return rightRows; + } + + public static void downloadExcel(File excelFile, String fileName, HttpServletResponse response) throws Exception{ + response.setContentType("application/octet-stream"); + fileName = new String(fileName.getBytes("gbk"),"ISO8859_1"); + response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + ".xls" + "\""); + FileInputStream fis = new FileInputStream(excelFile); + OutputStream out = response.getOutputStream(); + + int SIZE = 1024 * 1024; + byte[] bytes = new byte[SIZE]; + int LENGTH = -1; + while((LENGTH = fis.read(bytes)) != -1){ + out.write(bytes,0,LENGTH); + } + out.flush(); + fis.close(); + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/ExceptionCodeConstants.java b/src/main/java/com/wansensoft/erp/utils/ExceptionCodeConstants.java new file mode 100644 index 00000000..1e46aba0 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ExceptionCodeConstants.java @@ -0,0 +1,43 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/ExtJsonUtils.java b/src/main/java/com/wansensoft/erp/utils/ExtJsonUtils.java new file mode 100644 index 00000000..1b17a0ab --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ExtJsonUtils.java @@ -0,0 +1,141 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/FileUtils.java b/src/main/java/com/wansensoft/erp/utils/FileUtils.java new file mode 100644 index 00000000..28bd9253 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/FileUtils.java @@ -0,0 +1,353 @@ +package com.wansensoft.erp.utils; + +import java.io.*; +import java.util.*; + +/** + * + * 文件处理工具类 + * + */ +public class FileUtils { + + /** + * 功 能: 创建文件夹 + * + * @param path + * 参 数:要创建的文件夹名称 + * @return 返回值: 如果成功true;否则false 如:FileUtils.mkdir("/usr/apps/upload/"); + */ + public static boolean makedir(String path) { + File file = new File(path); + if (!file.exists()) + return file.mkdirs(); + else + return true; + } + + /** + * 保存文件 + * + * @param stream + * @param path + * 存放路径 + * @param filename + * 文件名 + * @throws IOException + */ + public static void SaveFileFromInputStream(InputStream stream, String path, String filename) + throws IOException { + File file = new File(path); + boolean flag=true; + if(!file.exists()){ + flag=file.mkdirs(); + } + if(flag){ + FileOutputStream fs = new FileOutputStream(new File(path+filename)); + byte[] buffer = new byte[1024 * 1024]; + int byteread = 0; + while ((byteread = stream.read(buffer)) != -1) { + fs.write(buffer, 0, byteread); + fs.flush(); + } + fs.close(); + stream.close(); + } + } + + + /** + * 列出某个目录下的所有文件,子目录不列出 + * @param folderPath:文件夹路径 + * @return + */ + public static List listFile(String folderPath){ + List fileList = new ArrayList(); //FileViewer.getListFiles(destPath, null, false); + File f = new File(folderPath); + File[] t = f.listFiles(); + for(int i = 0; i < t.length; i++){ + fileList.add(t[i].getAbsolutePath()); + } + return fileList; + } + + + /** + * 判断文件是否存在 + * + * @param fileName + * @return + */ + public static boolean exists(String fileName) { + File file = new File(fileName); + if (file.exists()) { + return true; + } else { + return false; + } + } + + /** + * 取当前路径 + * + * @return + */ + public static String getCurrentPath() { + File directory = new File("."); + String nowPath = ""; + try { + nowPath = directory.getCanonicalFile().toString(); + } catch (IOException e) { + e.printStackTrace(); + } + return nowPath; + } + + /** + * 获取文件扩展名 + * + * @param fileName + * @return + * */ + public static String getFileExtendName(String fileName) { + if (fileName == null) { + return ""; + } else { + return fileName.substring(fileName.lastIndexOf(".") + 1, fileName + .length()); + } + } + + /** + * 创建一个新文件,如果存在则报错 + * + * @param filePath + * @param fileName + * @return + */ + public static void createFile(String filePath, String fileName) + throws RuntimeException { + String file = null; + if (filePath == null) { + file = fileName; + } else { + file = filePath + File.separator + fileName; + } + createFile(file); + } + + /** + * 创建一个新文件(含路径),如果存在则报错 + * + * @param fileName + * 含有路径的文件名 + * @return + */ + public static void createFile(String fileName) throws RuntimeException { + File f = new File(fileName); + if (f.exists()) { + throw new RuntimeException("FILE_EXIST_ERROR"); + } else { + try { + File fileFolder = f.getParentFile(); + if (!fileFolder.exists()) + fileFolder.mkdirs(); + f.createNewFile(); + } catch (IOException ie) { + System.out.println("文件" + fileName + "创建失败:" + ie.getMessage()); + throw new RuntimeException("FILE_CREATE_ERROR"); + } + } + } + + + /** + * 创建目录,如果存在则不创建 + * + * @param path + * @return 返回结果null则创建成功,否则返回的是错误信息 + * @return + */ + public static String createDir(String path, boolean isCreateSubPah) { + String msg = null; + File dir = new File(path); + + if (dir == null) { + msg = "不能创建空目录"; + return msg; + } + if (dir.isFile()) { + msg = "已有同名文件存在"; + return msg; + } + if (!dir.exists()) { + if (isCreateSubPah && !dir.mkdirs()) { + msg = "目录创建失败,原因不明"; + } else if (!dir.mkdir()) { + msg = "目录创建失败,原因不明"; + } + } + return msg; + } + + /** + * 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件 + * + * @file:File 目录 + * */ + public static void delFileOrFolder(String fileName) { + if (!exists(fileName)) + return; + File file = new File(fileName); + delFileOrFolder(file); + } + + /** + * 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件 + * + * @file:File 目录 + * */ + public static void delFileOrFolder(File file) { + if (!file.exists()) + return; + if (file.isFile()) { + file.delete(); + } else { + File[] sub = file.listFiles(); + if (sub == null || sub.length <= 0) { + file.delete(); + } else { + for (int i = 0; i < sub.length; i++) { + delFileOrFolder(sub[i]); + } + file.delete(); + } + } + } + + /** + * 从Properties格式配置文件中获取所有参数并保存到HashMap中。 + * 配置中的key值即map表中的key值,如果配置文件保存时用的中文,则返回结果也会转成中文。 + * + * @param file + * @return + * @throws IOException + */ + @SuppressWarnings("unchecked") + public static HashMap readPropertyFile(String file, String charsetName) throws IOException { + if (charsetName==null || charsetName.trim().length()==0){ + charsetName="gbk"; + } + HashMap map = new HashMap(); + InputStream is =null; + if(file.startsWith("file:")) + is=new FileInputStream(new File(file.substring(5))); + else + is=FileUtils.class.getClassLoader().getResourceAsStream(file); + Properties properties = new Properties(); + properties.load(is); + Enumeration en = properties.propertyNames(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String code = new String(properties.getProperty(key).getBytes( + "ISO-8859-1"), charsetName); + map.put(key, code); + } + return map; + } + /** + * + * @param path + * 文件路径 + * @param suffix + * 后缀名 + * @param isdepth + * 是否遍历子目录 + * @return + */ + @SuppressWarnings("unchecked") + public static List getListFiles(String path, String suffix, boolean isdepth) { + File file = new File(path); + return FileUtils.listFile(file, suffix, isdepth); + } + + /** + * @param f + * @param suffix:后缀名 + * @param isdepth:是否遍历子目录 + * @return + */ + @SuppressWarnings("unchecked") + public static List listFile(File f, String suffix, boolean isdepth) { + // 是目录,同时需要遍历子目录 + List fileList = new ArrayList(); + if (f.isDirectory() && isdepth == true) { + File[] t = f.listFiles(); + for (int i = 0; i < t.length; i++) { + listFile(t[i], suffix, isdepth); + } + } else { + String filePath = f.getAbsolutePath(); + + if (suffix != null) { + int begIndex = filePath.lastIndexOf(".");// 最后一个.(即后缀名前面的.)的索引 + String tempsuffix = ""; + + if (begIndex != -1)// 防止是文件但却没有后缀名结束的文件 + { + tempsuffix = filePath.substring(begIndex + 1, filePath + .length()); + } + + if (tempsuffix.equals(suffix)) { + fileList.add(filePath); + } + } else { + // 后缀名为null则为所有文件 + fileList.add(filePath); + } + + } + + return fileList; + } + + /** + * 方法追加文件:使用FileWriter + * + * @param fileName + * @param content + */ + public static void appendMethod(String fileName, String content) { + try { + // 打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件 + FileWriter writer = new FileWriter(fileName, true); + writer.write(content + "\r\n"); + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 判断文件名是否带盘符,重新处理 + * @param fileName + * @return + */ + public static String getFileName(String fileName){ + //判断是否带有盘符信息 + // Check for Unix-style path + int unixSep = fileName.lastIndexOf('/'); + // Check for Windows-style path + int winSep = fileName.lastIndexOf('\\'); + // Cut off at latest possible point + int pos = (winSep > unixSep ? winSep : unixSep); + if (pos != -1) { + // Any sort of path separator found... + fileName = fileName.substring(pos + 1); + } + //替换上传文件名字的特殊字符 + fileName = fileName.replace("=","").replace(",","").replace("&",""); + return fileName; + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/HttpClient.java b/src/main/java/com/wansensoft/erp/utils/HttpClient.java new file mode 100644 index 00000000..c190435e --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/HttpClient.java @@ -0,0 +1,88 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/JsonUtils.java b/src/main/java/com/wansensoft/erp/utils/JsonUtils.java new file mode 100644 index 00000000..b176ab09 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/JsonUtils.java @@ -0,0 +1,22 @@ +package com.wansensoft.erp.utils; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +/** + * Created by jishenghua 2018-5-11 09:48:08 + * + * @author jishenghua + */ +public class JsonUtils { + + public static JSONObject ok(){ + JSONObject obj = new JSONObject(); + JSONObject tmp = new JSONObject(); + tmp.put("message", "成功"); + obj.put("code", 200); + obj.put("data", tmp); + return obj; + } + +} diff --git a/src/main/java/com/wansensoft/erp/utils/OrderUtils.java b/src/main/java/com/wansensoft/erp/utils/OrderUtils.java new file mode 100644 index 00000000..b031d8f9 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/OrderUtils.java @@ -0,0 +1,69 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/PageQueryInfo.java b/src/main/java/com/wansensoft/erp/utils/PageQueryInfo.java new file mode 100644 index 00000000..73725859 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/PageQueryInfo.java @@ -0,0 +1,30 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/ParamUtils.java b/src/main/java/com/wansensoft/erp/utils/ParamUtils.java new file mode 100644 index 00000000..5406d96d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ParamUtils.java @@ -0,0 +1,57 @@ +package com.wansensoft.erp.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 new StringBuffer().append(offset).toString(); + } + } + 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/src/main/java/com/wansensoft/erp/utils/QueryUtils.java b/src/main/java/com/wansensoft/erp/utils/QueryUtils.java new file mode 100644 index 00000000..0526746d --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/QueryUtils.java @@ -0,0 +1,142 @@ +package com.wansensoft.erp.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.erp.utils.Constants.CURRENT_PAGE; +import static com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/RandImageUtil.java b/src/main/java/com/wansensoft/erp/utils/RandImageUtil.java new file mode 100644 index 00000000..251b8f94 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/RandImageUtil.java @@ -0,0 +1,140 @@ +package com.wansensoft.erp.utils; + +import javax.imageio.ImageIO; +import jakarta.servlet.http.HttpServletResponse; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Base64; +import java.util.Random; + +/** + * 登录验证码工具类 + */ +public class RandImageUtil { + + public static final String key = "JEECG_LOGIN_KEY"; + + /** + * 定义图形大小 + */ + private static final int width = 105; + /** + * 定义图形大小 + */ + private static final int height = 35; + + /** + * 定义干扰线数量 + */ + private static final int count = 200; + + /** + * 干扰线的长度=1.414*lineWidth + */ + private static final int lineWidth = 2; + + /** + * 图片格式 + */ + private static final String IMG_FORMAT = "JPEG"; + + /** + * base64 图片前缀 + */ + private static final String BASE64_PRE = "data:image/jpg;base64,"; + + /** + * 直接通过response 返回图片 + * @param response + * @param resultCode + * @throws IOException + */ + public static void generate(HttpServletResponse response, String resultCode) throws IOException { + BufferedImage image = getImageBuffer(resultCode); + // 输出图象到页面 + ImageIO.write(image, IMG_FORMAT, response.getOutputStream()); + } + + /** + * 生成base64字符串 + * @param resultCode + * @return + * @throws IOException + */ + public static String generate(String resultCode) throws IOException { + BufferedImage image = getImageBuffer(resultCode); + + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); + //写入流中 + ImageIO.write(image, IMG_FORMAT, byteStream); + //转换成字节 + byte[] bytes = byteStream.toByteArray(); + //转换成base64串 + String base64 = Base64.getEncoder().encodeToString(bytes).trim(); + base64 = base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n + + //写到指定位置 + //ImageIO.write(bufferedImage, "png", new File("")); + + return BASE64_PRE+base64; + } + + private static BufferedImage getImageBuffer(String resultCode){ + // 在内存中创建图象 + final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + // 获取图形上下文 + final Graphics2D graphics = (Graphics2D) image.getGraphics(); + // 设定背景颜色 + graphics.setColor(Color.WHITE); // ---1 + graphics.fillRect(0, 0, width, height); + // 设定边框颜色 +// graphics.setColor(getRandColor(100, 200)); // ---2 + graphics.drawRect(0, 0, width - 1, height - 1); + + final Random random = new Random(); + // 随机产生干扰线,使图象中的认证码不易被其它程序探测到 + for (int i = 0; i < count; i++) { + graphics.setColor(getRandColor(150, 200)); // ---3 + + final int x = random.nextInt(width - lineWidth - 1) + 1; // 保证画在边框之内 + final int y = random.nextInt(height - lineWidth - 1) + 1; + final int xl = random.nextInt(lineWidth); + final int yl = random.nextInt(lineWidth); + graphics.drawLine(x, y, x + xl, y + yl); + } + // 取随机产生的认证码 + for (int i = 0; i < resultCode.length(); i++) { + // 将认证码显示到图象中,调用函数出来的颜色相同,可能是因为种子太接近,所以只能直接生成 + // graphics.setColor(new Color(20 + random.nextInt(130), 20 + random + // .nextInt(130), 20 + random.nextInt(130))); + // 设置字体颜色 + graphics.setColor(Color.BLACK); + // 设置字体样式 +// graphics.setFont(new Font("Arial Black", Font.ITALIC, 18)); + graphics.setFont(new Font("Times New Roman", Font.BOLD, 24)); + // 设置字符,字符间距,上边距 + graphics.drawString(String.valueOf(resultCode.charAt(i)), (23 * i) + 8, 26); + } + // 图象生效 + graphics.dispose(); + return image; + } + + private static Color getRandColor(int fc, int bc) { // 取得给定范围随机颜色 + final Random random = new Random(); + if (fc > 255) { + fc = 255; + } + if (bc > 255) { + bc = 255; + } + + final int r = fc + random.nextInt(bc - fc); + final int g = fc + random.nextInt(bc - fc); + final int b = fc + random.nextInt(bc - fc); + + return new Color(r, g, b); + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/RegExpTools.java b/src/main/java/com/wansensoft/erp/utils/RegExpTools.java new file mode 100644 index 00000000..f82959d5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/RegExpTools.java @@ -0,0 +1,154 @@ +package com.wansensoft.erp.utils; + +import org.springframework.util.Assert; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Adm on 2015/12/14. + * + * @author yubiao + *

+ * mysql匹配正则表达式 + */ +public class RegExpTools { + /** + * @param search 模糊匹配字符串数组 + */ + public static String regexp(List search) { + if (search == null || search.isEmpty()) + return null; + String regexp = ""; + for (String s : search) { + if (!regexp.isEmpty()) { + regexp = regexp + "|"; + } + regexp = regexp + ".*"; + regexp = regexp + s.replaceAll("\\.", "\\\\."); + regexp = regexp + ".*"; + } + return regexp; + } + + /** + * @param key json字段key + * @param search 模糊匹配字符串数组 + * json的mysql匹配正则表达式 + */ + public static String regexp(String key, List search) { + if (search == null || search.isEmpty()) + return null; + StringBuilder sb = new StringBuilder(); + for (String s : search) { + if (sb.length() == 0) { + sb.append(".*\\\"").append(key).append("\\\":\\\"[a-zA-Z0-9]*("); + } else { + sb.append("|"); + } + sb.append(s); + } + sb.append(")[a-zA-Z0-9]*\\\".*"); + return sb.toString(); + } + + public static class RegExp { + public static final String ANY = ".*"; + public static final String QUOTE = "\\\""; + public static final String LFT_PAREN = "("; + public static final String RHT_PAREN = ")"; + public static final String COLON = ":"; + public static final String OR = "|"; + + private final StringBuilder builder = new StringBuilder(); + + public RegExp any() { + builder.append(ANY); + return this; + } + + public RegExp lftParen() { + builder.append(LFT_PAREN); + return this; + } + + public RegExp rhtParen() { + builder.append(RHT_PAREN); + return this; + } + + public RegExp colon() { + builder.append(COLON); + return this; + + } + + public RegExp quote() { + builder.append(QUOTE); + return this; + } + + public RegExp quote(String str) { + Assert.notNull(str, "str为空"); + builder.append(QUOTE).append(str).append(QUOTE); + return this; + } + + public RegExp value(String str) { + Assert.notNull(str, "str为空"); + builder.append(str); + return this; + } + + public RegExp or() { + builder.append(OR); + return this; + } + + public RegExp or(List values) { + Assert.notEmpty(values, "values必须非空"); + lftParen(); + boolean first = true; + for (String value : values) { + if (first) { + builder.append(value); + first = false; + } else { + builder.append(OR).append(value); + } + } + rhtParen(); + return this; + } + + @Override + public String toString() { + return builder.toString(); + } + + public static void main(String[] args) { + List values = new ArrayList(); + + values.add("310"); + values.add(String.valueOf(2)); + values.add(String.valueOf(3)); + + RegExp exp = new RegExp(); + + exp.any(); + exp.quote("fullKbNum").colon() + .quote() + .value("[a-zA-Z0-9]*").or(values).value("[a-zA-Z0-9]*") + .quote(); + exp.or(); + exp.quote("gbId[a-f0-9-]{36}").colon() + .quote() + .value("[0-9]*").or(values).value("[0-9]*") + .quote(); + exp.any(); + + System.out.println(exp); + } + + } +} diff --git a/src/main/java/com/wansensoft/erp/utils/ResponseCode.java b/src/main/java/com/wansensoft/erp/utils/ResponseCode.java new file mode 100644 index 00000000..94fd4e3f --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ResponseCode.java @@ -0,0 +1,24 @@ +package com.wansensoft.erp.utils; + +import com.alibaba.fastjson.annotation.JSONCreator; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class ResponseCode { + + public final int code; + public final Object data; + + /** + * + * @param code + * @param data + */ + @JSONCreator + public ResponseCode(@JSONField(name = "code") int code, @JSONField(name = "data")Object data) { + this.code = code; + this.data = data; + } +} \ No newline at end of file diff --git a/src/main/java/com/wansensoft/erp/utils/ResponseJsonUtil.java b/src/main/java/com/wansensoft/erp/utils/ResponseJsonUtil.java new file mode 100644 index 00000000..bbdaeb39 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/ResponseJsonUtil.java @@ -0,0 +1,83 @@ +package com.wansensoft.erp.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; + } + } + } + + /** + * + * @param responseCode + * @return + */ + 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; + } + + /** + * 验证失败的json串 + * @param code + * @return + */ + 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); + } + + /** + * 成功的json串 + * @param responseCode + * @return + */ + 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/src/main/java/com/wansensoft/erp/utils/StringUtil.java b/src/main/java/com/wansensoft/erp/utils/StringUtil.java new file mode 100644 index 00000000..ae319fe5 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/StringUtil.java @@ -0,0 +1,373 @@ +package com.wansensoft.erp.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/src/main/java/com/wansensoft/erp/utils/Tools.java b/src/main/java/com/wansensoft/erp/utils/Tools.java new file mode 100644 index 00000000..b080e082 --- /dev/null +++ b/src/main/java/com/wansensoft/erp/utils/Tools.java @@ -0,0 +1,760 @@ +package com.wansensoft.erp.utils; + +import org.springframework.util.StringUtils; +import jakarta.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.net.InetAddress; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.net.UnknownHostException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Pattern; + +/** + * 工具类 + * + * @author jishenghua qq:7-5-2-7-1-8-9-2-0 + */ +public class Tools { + /** + * 获得32位唯一序列号 + * + * @return 32为ID字符串 + */ + public static String getUUID_32() { + return UUID.randomUUID().toString().replaceAll("-", ""); + } + + /** + * 获得当天时间,格式为yyyy-MM-dd + * + * @return 格式化后的日期格式 + */ + public static String getNow() { + return new SimpleDateFormat("yyyy-MM-dd").format(new Date()); + } + + /** + * 获取昨天的日期字符串 + * @return + */ + public static String getYesterday(){ + Date date=new Date();//取时间 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) + calendar.add(Calendar.DATE,-1); + //这个时间就是日期往前推一天的结果 + date=calendar.getTime(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + return formatter.format(date); + } + + /** + * 获取当年的第一天 + * @return + */ + public static String getYearBegin(){ + String yearStr = new SimpleDateFormat("yyyy").format(new Date()); + return yearStr + "-01-01"; + } + + /** + * 获取当年的最后一天 + * @return + */ + public static String getYearEnd(){ + String yearStr = new SimpleDateFormat("yyyy").format(new Date()); + return yearStr + "-12-31"; + } + + /** + * 获取当前月 yyyy-MM + * + * @return + */ + public static String getCurrentMonth() { + return new SimpleDateFormat("yyyy-MM").format(new Date()); + } + + /** + * 获取指定日期格式 yyyy-MM-dd + * + * @return + */ + public static String parseDateToStr(Date date) { + if(date!=null) { + return new SimpleDateFormat("yyyy-MM-dd").format(date); + } else { + return ""; + } + } + + /** + * 获得当天时间,格式为yyyyMMddHHmmss + * + * @return 格式化后的日期格式 + */ + public static String getNow2(Date date) { + return new SimpleDateFormat("yyyyMMddHHmmss").format(date); + } + + /** + * 获得当天时间,格式为yyyy-MM-dd HH:mm:ss + * + * @return 格式化后的日期格式 + */ + public static String getNow3() { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + } + + /** + * 获得指定时间,格式为yyyy-MM-dd HH:mm:ss + * + * @return 格式化后的日期格式 + */ + 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 + * + * @return 格式化后的日期格式 + */ + public static String getTimeInfo(Date date) { + return new SimpleDateFormat("mm:ss").format(date); + } + + /** + * 获取当前日期是星期几 + * return 星期几 + */ + public static String getWeekDay() { + Calendar c = Calendar.getInstance(Locale.CHINA); + c.setTime(new Date()); + int day = c.get(Calendar.DAY_OF_WEEK); + String weekDay = ""; + switch (day) { + case 1: + weekDay = "星期日"; + break; + case 2: + weekDay = "星期一"; + break; + case 3: + weekDay = "星期二"; + break; + case 4: + weekDay = "星期三"; + break; + case 5: + weekDay = "星期四"; + break; + case 6: + weekDay = "星期五"; + break; + case 7: + weekDay = "星期六"; + break; + default: + break; + } + return weekDay; + } + + /** + * 判断字符串是否全部为数字 + * + * @param checkStr + * @return boolean值 + */ + public static boolean checkStrIsNum(String checkStr) { + if (checkStr == null || checkStr.length() == 0) + return false; + return Pattern.compile("^[0-9]*.{1}[0-9]*$").matcher(checkStr).matches(); +// return Pattern.compile(":^[0-9]+(.[0-9])*$").matcher(checkStr).matches(); + } + + /** + * 获得前一天的时间 + * + * @return 前一天日期 + */ + public static String getPreviousDate() { + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, -1); + return new SimpleDateFormat("yyyy-MM").format(cal.getTime()); + } + + /** + * 获取当前月份的前6个月(含当前月) + * @param size 月数 + * @return + */ + public static List getLastMonths(int size) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + List list = new ArrayList(size); + for (int i=0;i cutLeng) + return beforeStr.substring(0, cutLeng) + "..."; + return beforeStr; + } + + /** + * 生成随机字符串,字母和数字混合 + * + * @return 组合后的字符串 ^[0-9a-zA-Z] + */ + public static String getRandomChar() { + //生成一个0、1、2的随机数字 + int rand = (int) Math.round(Math.random() * 1); + long itmp = 0; + char ctmp = '\u0000'; + switch (rand) { + //生成大写字母 + 1000以内数字 + case 1: + itmp = Math.round(Math.random() * 25 + 65); + ctmp = (char) itmp; + return String.valueOf(ctmp) + (int) Math.random() * 1000; + //生成小写字母 + case 2: + itmp = Math.round(Math.random() * 25 + 97); + ctmp = (char) itmp; + return String.valueOf(ctmp) + (int) Math.random() * 1000; + //生成数字 + default: + itmp = Math.round(Math.random() * 1000); + return itmp + ""; + } + } + + /** + * 判断首字母以数字开头,字符串包括数字、字母%以及空格 + * + * @param str 检查字符串 + * @return 是否以数字开头 + */ + public static boolean CheckIsStartWithNum(String str) { + return Pattern.compile("^[0-9][a-zA-Z0-9%,\\s]*$").matcher(str).matches(); + } + + /** + * 判断首字母以","开头,字符串包括数字、字母%以及空格 + * + * @param str 检查字符串 + * @return 是否以数字开头 + */ + public static boolean CheckIsStartWithSpec(String str) { + return Pattern.compile("^[,][a-zA-Z0-9%,\\s]*$").matcher(str).matches(); + } + + /** + * 字符转码 + * + * @param aValue + * @return + * @see 转码后的字符串 + */ + public static String encodeValue(String aValue) { + if (aValue.trim().length() == 0) { + return ""; + } + String valueAfterTransCode = null; + try { + valueAfterTransCode = URLEncoder.encode(aValue, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.getMessage(); + } + return valueAfterTransCode; + } + + /** + * 字符转码 + * + * @param aValue + * @return + * @see 转码后的字符串 + */ + public static String decodeValue(String aValue) { + if (aValue.trim().length() == 0) { + return ""; + } + String valueAfterTransCode = null; + try { + valueAfterTransCode = URLDecoder.decode(aValue, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.getMessage(); + } + return valueAfterTransCode; + } + + /** + * 去除str中的' + * + * @param str + * @return 除去'后的字符串 + * @see [类、类#方法、类#成员] + */ + public static String afterDealStr(String str) { + return str.replace("'", ""); + } + + /** + * 获取用户IP地址(停用) + * + * @return 用户IP + * @see [类、类#方法、类#成员] + */ + public static String getCurrentUserIP() { + try { + return InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + e.printStackTrace(); + return "127.0.0.1"; + } + } + + /** + * 从Request对象中获得客户端IP,处理了HTTP代理服务器和Nginx的反向代理截取了ip + * + * @param request + * @return ip + */ + public static String getLocalIp(HttpServletRequest request) { + String remoteAddr = getIpAddr(request); + String forwarded = request.getHeader("X-Forwarded-For"); + String realIp = request.getHeader("X-Real-IP"); + + String ip = null; + if (realIp == null) { + if (forwarded == null) { + ip = remoteAddr; + } else { + ip = remoteAddr + "/" + forwarded.split(",")[0]; + } + } else { + if (realIp.equals(forwarded)) { + ip = realIp; + } else { + if (forwarded != null) { + forwarded = forwarded.split(",")[0]; + } + ip = realIp + "/" + forwarded; + } + } + return ip; + } + /** + * 获取访问者IP + * + * 在一般情况下使用Request.getRemoteAddr()即可,但是经过nginx等反向代理软件后,这个方法会失效。 + * + * 本方法先从Header中获取X-Real-IP,如果不存在再从X-Forwarded-For获得第一个IP(用,分割), + * 如果还不存在则调用Request .getRemoteAddr()。 + * + * @param request + * @return + */ + public static String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("X-Real-IP"); + if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) { + return ip; + } + ip = request.getHeader("X-Forwarded-For"); + if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) { + // 多次反向代理后会有多个IP值,第一个为真实IP。 + int index = ip.indexOf(','); + if (index != -1) { + return ip.substring(0, index); + } else { + return ip; + } + } else { + return request.getRemoteAddr(); + } + } + + /** + * 转化前台批量传入的ID值 + * + * @param data + * @return 转化后的ID值数组 + */ + public static int[] changeDataForm(String data) { + String[] dataStr = data.split(","); + int[] dataInt = new int[dataStr.length]; + for (int i = 0; i < dataStr.length; i++) + dataInt[i] = Integer.parseInt(dataStr[i]); + return dataInt; + } + + /** + * 解决导出文件中文乱码问题firefox和ie下中文乱码 + */ + public static String changeUnicode(String fileName, String browserType) { + String returnFileName = ""; + try { + if (browserType.equalsIgnoreCase("MSIE")) { + returnFileName = URLEncoder.encode(fileName, "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + if (returnFileName.length() > 150) { + returnFileName = new String(fileName.getBytes("GB2312"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } + } else if (browserType.equalsIgnoreCase("Firefox")) { + returnFileName = new String(fileName.getBytes("ISO8859-1"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } else { + returnFileName = URLEncoder.encode(fileName, "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + if (returnFileName.length() > 150) { + + returnFileName = new String(returnFileName.getBytes("GB2312"), "ISO8859-1"); + returnFileName = returnFileName.replace(" ", "%20"); + } + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return returnFileName; + } + + /** + * 写理财日志内容转化特殊字符 + * + * @param str 需要转化的字符 + * @return 转化后的字符 + */ + public static String htmlspecialchars(String str) { + str = str.replaceAll("&", "&"); + str = str.replaceAll("<", "<"); + str = str.replaceAll(">", ">"); + str = str.replaceAll("\"", """); + return str; + } + + /** + * 根据消费日期获取消费月 + * + * @param consumeDate 消费日期 + * @return 返回消费月信息 + */ + public static String getConsumeMonth(String consumeDate) { + return consumeDate.substring(0, 7); + } + + /** + * 获取当前日期的前XX个月 + * + * @param beforeMonth + * @return 前XX个月字符串 + */ + public static String getBeforeMonth(int beforeMonth) { + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, -beforeMonth); + return new SimpleDateFormat("yyyy-MM").format(c.getTime()); + } + + /** + * 根据月份获取当月第一天 + * @param monthTime + * @return + * @throws ParseException + */ + public static String firstDayOfMonth(String monthTime) throws ParseException { + return monthTime + "-01"; + } + + /** + * 根据月份获取当月最后一天 + * @param monthTime + * @return + * @throws ParseException + */ + public static String lastDayOfMonth(String monthTime) throws ParseException { + Date date = new SimpleDateFormat("yyyy-MM").parse(monthTime); + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + } + + /** + * 获取email用户姓名 + * + * @param emailAddress + */ + public static String getEmailUserName(String emailAddress) { + return emailAddress.substring(0, emailAddress.lastIndexOf("@")); + } + + /** + * 获取中文编码,邮件附件乱码问题解决 + * + * @param emailAttchmentTitle + * @return + */ + public static String getChineseString(String emailAttchmentTitle) { + if (emailAttchmentTitle != null && !emailAttchmentTitle.equals("")) { + try { + return new String(emailAttchmentTitle.getBytes(), "ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return emailAttchmentTitle; + } + + /** + * 判断userTel是否合法,userTel只能是数字 + * + * @param userTel + * @return true 合法 false不合法 + */ + public static boolean isTelNumber(String userTel) { + String reg_phone = "^(\\(\\d{3,4}\\)|\\d{3,4}-)?\\d{7,8}$"; + String reg_tel = "^(1[0-9][0-9]|1[0-9][0|3|6|8|9])\\d{8}$"; + boolean b_phpne = Pattern.compile(reg_phone).matcher(userTel).matches(); + boolean b_tel = Pattern.compile(reg_tel).matcher(userTel).matches(); + return (b_phpne || b_tel); + } + + /** + * 模糊判断电话号码是否合法,只能是数字 + * + * @param userTel + * @return + */ + public static boolean isTelNumberBySlur(String userTel) { + return Pattern.compile("^([\\s0-9]{0,12}$)").matcher(userTel).matches(); + } + + /** + * 获取当前时间的字符串类型 + * + * @return 处理后的字符串类型 + */ + public static String getNowTime() { + return new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime()); + } + + /** + * 开打指定文件 + * + * @param filePath 文件的绝对路径 + */ + public static void openFile(String filePath) { + String viewFilePath = filePath.replace("\\", "/"); + // Runtime.getRuntime().exec("cmd /c start "+filePath); + // 解决路径中带空格问题 + Runtime r = Runtime.getRuntime(); + String[] cmdArray = new String[]{"cmd.exe", "/c", viewFilePath}; + try { + r.exec(cmdArray); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 判断字符串中是否含有中文 + * + * @param str + * @return + * @author jishenghua + */ + public static boolean isContainsChinese(String str) { + return Pattern.compile("[\u4e00-\u9fa5]").matcher(str).matches(); + } + + /** + * 过滤html文件中的文本 + * + * @param content + * @return过滤后的文本 + */ + public static String filterText(String content) { + return content.replace("/<(?:.|\\s)*?>/g", ""); + } + + /** + * 去掉字符串中所有符号,不论是全角,还是半角的,或是货币符号或者空格等 + * + * @param s + * @return + * @author jishenghua + */ + public static String removeSymbolForString(String s) { + StringBuffer buffer = new StringBuffer(); + char[] chars = s.toCharArray(); + for (int i = 0; i < chars.length; i++) { + if ((chars[i] >= 19968 && chars[i] <= 40869) || (chars[i] >= 97 && chars[i] <= 122) || (chars[i] >= 65 && chars[i] <= 90)) { + buffer.append(chars[i]); + } + } + return buffer.toString(); + } + + /** + * 获取一个字符串的MD5 + * + * @param msg + * @return 加密后的MD5字符串 + * @throws NoSuchAlgorithmException + */ + public static String md5Encryp(String msg) throws NoSuchAlgorithmException { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(msg.getBytes()); + return new BigInteger(1, md.digest()).toString(16); + } + + /** + * 判断是否插件URL + * + * @return + */ + public static boolean isPluginUrl(String url) { + if (url != null && (url.startsWith("/plugin"))) { + return true; + } + return false; + } + + /** + * 处理字符串null值 + * + * @param beforeStr 处理前字符串 + * @return 处理后的字符串 + */ + public static String dealNullStr(String beforeStr) { + if (null == beforeStr || beforeStr.length() == 0) + return ""; + 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 + * + * @param strDate + * @param pattern + * @return + * @throws ParseException + * @author jishenghua + */ + public static Date parse(String strDate, String pattern) + throws ParseException { + return new SimpleDateFormat(pattern).parse(strDate); + } + + public static Date addDays(Date date, int num) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); //需要将date数据转移到Calender对象中操作 + calendar.add(calendar.DATE, num);//把日期往后增加n天.正数往后推,负数往前移动 + date=calendar.getTime(); //这个时间就是日期往后推一天的结果 + return date; + } + + /** + * 生成随机数字和字母组合 + * @param length + * @return + */ + public static String getCharAndNum(int length) { + Random random = new Random(); + StringBuffer valSb = new StringBuffer(); + String charStr = "0123456789abcdefghijklmnopqrstuvwxyz"; + int charLength = charStr.length(); + for (int i = 0; i < length; i++) { + int index = random.nextInt(charLength); + valSb.append(charStr.charAt(index)); + } + return valSb.toString(); + } + +// /** +// * 过滤html文件中的图片文件 +// * @param content +// * @return +// */ +// public static String filterImg(String content) +// { +// return content.matches("//g"); +// } + + public static void main(String[] args) { + String aa = "的付的反对法的发的说法"; + char[] bb = aa.toCharArray(); + for (char c : bb) { + System.out.println(c); + } + System.out.println(getBeforeMonth(1)); + + 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)); + + for (int i = 0; i < 100; i++) { + System.out.print(getRandomChar() + " || "); + } + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 00000000..d61cfac2 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,38 @@ +server.port=9999 + +server.servlet.session.timeout=36000 + +server.servlet.context-path=/wansenerp + +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/wansenerp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false +spring.datasource.driverClassName=com.mysql.jdbc.Driver +spring.datasource.username=root +spring.datasource.password=PaSsw0Rd + +mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml +# Redis +spring.data.redis.host=127.0.0.1 +spring.data.redis.port=6379 +spring.data.redis.password=123456 + +manage.roleId=10 + +tenant.userNumLimit=1000000 + +tenant.tryDayLimit=3000 + +plugin.runMode=prod +plugin.pluginPath=plugins +plugin.pluginConfigFilePath=pluginConfig + +file.uploadType=1 + +file.path=/opt/wansenerp/upload + +server.tomcat.basedir=/opt/tmp/tomcat + +spring.servlet.multipart.max-file-size=10485760 +spring.servlet.multipart.max-request-size=10485760 + +spring.main.allow-circular-references=true +spring.mvc.pathmatch.matching-strategy=ant_path_matcher \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..86291bb2 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + + ${LOG_PATTERN} + + + + + ${LOG_FILE}.log + + ${LOG_PATTERN} + + + ${LOG_FILE}.%d{yyyy-MM-dd}.%i.log + 10 + 1GB + + 100MB + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/AccountHeadMapper.xml b/src/main/resources/mapper_xml/AccountHeadMapper.xml new file mode 100644 index 00000000..dfadde0f --- /dev/null +++ b/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/src/main/resources/mapper_xml/AccountHeadMapperEx.xml b/src/main/resources/mapper_xml/AccountHeadMapperEx.xml new file mode 100644 index 00000000..4738bf8f --- /dev/null +++ b/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/src/main/resources/mapper_xml/AccountItemMapper.xml b/src/main/resources/mapper_xml/AccountItemMapper.xml new file mode 100644 index 00000000..cf0129c7 --- /dev/null +++ b/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/src/main/resources/mapper_xml/AccountItemMapperEx.xml b/src/main/resources/mapper_xml/AccountItemMapperEx.xml new file mode 100644 index 00000000..8ce60521 --- /dev/null +++ b/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/src/main/resources/mapper_xml/AccountMapper.xml b/src/main/resources/mapper_xml/AccountMapper.xml new file mode 100644 index 00000000..0377a9d9 --- /dev/null +++ b/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/src/main/resources/mapper_xml/AccountMapperEx.xml b/src/main/resources/mapper_xml/AccountMapperEx.xml new file mode 100644 index 00000000..2e6a02ff --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotHeadMapper.xml b/src/main/resources/mapper_xml/DepotHeadMapper.xml new file mode 100644 index 00000000..6f39ad54 --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml new file mode 100644 index 00000000..f4294529 --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotItemMapper.xml b/src/main/resources/mapper_xml/DepotItemMapper.xml new file mode 100644 index 00000000..cf0b1fa0 --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/src/main/resources/mapper_xml/DepotItemMapperEx.xml new file mode 100644 index 00000000..1bba4b44 --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotMapper.xml b/src/main/resources/mapper_xml/DepotMapper.xml new file mode 100644 index 00000000..13e53b43 --- /dev/null +++ b/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/src/main/resources/mapper_xml/DepotMapperEx.xml b/src/main/resources/mapper_xml/DepotMapperEx.xml new file mode 100644 index 00000000..6da9baad --- /dev/null +++ b/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/src/main/resources/mapper_xml/FunctionMapper.xml b/src/main/resources/mapper_xml/FunctionMapper.xml new file mode 100644 index 00000000..7c121b86 --- /dev/null +++ b/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/src/main/resources/mapper_xml/FunctionMapperEx.xml b/src/main/resources/mapper_xml/FunctionMapperEx.xml new file mode 100644 index 00000000..3baa3b5e --- /dev/null +++ b/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/src/main/resources/mapper_xml/InOutItemMapper.xml b/src/main/resources/mapper_xml/InOutItemMapper.xml new file mode 100644 index 00000000..798d7904 --- /dev/null +++ b/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/src/main/resources/mapper_xml/InOutItemMapperEx.xml b/src/main/resources/mapper_xml/InOutItemMapperEx.xml new file mode 100644 index 00000000..64ec6163 --- /dev/null +++ b/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/src/main/resources/mapper_xml/LogMapper.xml b/src/main/resources/mapper_xml/LogMapper.xml new file mode 100644 index 00000000..b02bd731 --- /dev/null +++ b/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/src/main/resources/mapper_xml/LogMapperEx.xml b/src/main/resources/mapper_xml/LogMapperEx.xml new file mode 100644 index 00000000..9a9ea41d --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialAttributeMapper.xml b/src/main/resources/mapper_xml/MaterialAttributeMapper.xml new file mode 100644 index 00000000..e518cea6 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialAttributeMapperEx.xml b/src/main/resources/mapper_xml/MaterialAttributeMapperEx.xml new file mode 100644 index 00000000..46cf9add --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialCategoryMapper.xml b/src/main/resources/mapper_xml/MaterialCategoryMapper.xml new file mode 100644 index 00000000..8f0655f8 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml b/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml new file mode 100644 index 00000000..101d056c --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml b/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml new file mode 100644 index 00000000..b2abdaf0 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialCurrentStockMapperEx.xml b/src/main/resources/mapper_xml/MaterialCurrentStockMapperEx.xml new file mode 100644 index 00000000..216c0dfb --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialExtendMapper.xml b/src/main/resources/mapper_xml/MaterialExtendMapper.xml new file mode 100644 index 00000000..9115135c --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml b/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml new file mode 100644 index 00000000..a52101fb --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialInitialStockMapper.xml b/src/main/resources/mapper_xml/MaterialInitialStockMapper.xml new file mode 100644 index 00000000..61f5bcca --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml b/src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml new file mode 100644 index 00000000..756dc498 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialMapper.xml b/src/main/resources/mapper_xml/MaterialMapper.xml new file mode 100644 index 00000000..494d5232 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialMapperEx.xml b/src/main/resources/mapper_xml/MaterialMapperEx.xml new file mode 100644 index 00000000..3f5df002 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialPropertyMapper.xml b/src/main/resources/mapper_xml/MaterialPropertyMapper.xml new file mode 100644 index 00000000..8e047708 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml b/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml new file mode 100644 index 00000000..63179b62 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MsgMapper.xml b/src/main/resources/mapper_xml/MsgMapper.xml new file mode 100644 index 00000000..83897ea7 --- /dev/null +++ b/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/src/main/resources/mapper_xml/MsgMapperEx.xml b/src/main/resources/mapper_xml/MsgMapperEx.xml new file mode 100644 index 00000000..dbe22ae9 --- /dev/null +++ b/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/src/main/resources/mapper_xml/OrgaUserRelMapper.xml b/src/main/resources/mapper_xml/OrgaUserRelMapper.xml new file mode 100644 index 00000000..abbf5d61 --- /dev/null +++ b/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/src/main/resources/mapper_xml/OrgaUserRelMapperEx.xml b/src/main/resources/mapper_xml/OrgaUserRelMapperEx.xml new file mode 100644 index 00000000..0db66900 --- /dev/null +++ b/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/src/main/resources/mapper_xml/OrganizationMapper.xml b/src/main/resources/mapper_xml/OrganizationMapper.xml new file mode 100644 index 00000000..fda6744a --- /dev/null +++ b/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/src/main/resources/mapper_xml/OrganizationMapperEx.xml b/src/main/resources/mapper_xml/OrganizationMapperEx.xml new file mode 100644 index 00000000..082c1417 --- /dev/null +++ b/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/src/main/resources/mapper_xml/PersonMapper.xml b/src/main/resources/mapper_xml/PersonMapper.xml new file mode 100644 index 00000000..5dfba941 --- /dev/null +++ b/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/src/main/resources/mapper_xml/PersonMapperEx.xml b/src/main/resources/mapper_xml/PersonMapperEx.xml new file mode 100644 index 00000000..873b1b4b --- /dev/null +++ b/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/src/main/resources/mapper_xml/PlatformConfigMapper.xml b/src/main/resources/mapper_xml/PlatformConfigMapper.xml new file mode 100644 index 00000000..07c2bdf7 --- /dev/null +++ b/src/main/resources/mapper_xml/PlatformConfigMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + 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/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml b/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml new file mode 100644 index 00000000..f7478e8d --- /dev/null +++ b/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml @@ -0,0 +1,30 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/RoleMapper.xml b/src/main/resources/mapper_xml/RoleMapper.xml new file mode 100644 index 00000000..251399ca --- /dev/null +++ b/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/src/main/resources/mapper_xml/RoleMapperEx.xml b/src/main/resources/mapper_xml/RoleMapperEx.xml new file mode 100644 index 00000000..228b4b6e --- /dev/null +++ b/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/src/main/resources/mapper_xml/SequenceMapperEx.xml b/src/main/resources/mapper_xml/SequenceMapperEx.xml new file mode 100644 index 00000000..1e786399 --- /dev/null +++ b/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/src/main/resources/mapper_xml/SerialNumberMapper.xml b/src/main/resources/mapper_xml/SerialNumberMapper.xml new file mode 100644 index 00000000..91b1a3e0 --- /dev/null +++ b/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/src/main/resources/mapper_xml/SerialNumberMapperEx.xml b/src/main/resources/mapper_xml/SerialNumberMapperEx.xml new file mode 100644 index 00000000..1dbfe5e8 --- /dev/null +++ b/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/src/main/resources/mapper_xml/SupplierMapper.xml b/src/main/resources/mapper_xml/SupplierMapper.xml new file mode 100644 index 00000000..6e0001c9 --- /dev/null +++ b/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/src/main/resources/mapper_xml/SupplierMapperEx.xml b/src/main/resources/mapper_xml/SupplierMapperEx.xml new file mode 100644 index 00000000..e865f70e --- /dev/null +++ b/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/src/main/resources/mapper_xml/SystemConfigMapper.xml b/src/main/resources/mapper_xml/SystemConfigMapper.xml new file mode 100644 index 00000000..dca6f353 --- /dev/null +++ b/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/src/main/resources/mapper_xml/SystemConfigMapperEx.xml b/src/main/resources/mapper_xml/SystemConfigMapperEx.xml new file mode 100644 index 00000000..94d09001 --- /dev/null +++ b/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/src/main/resources/mapper_xml/TenantMapper.xml b/src/main/resources/mapper_xml/TenantMapper.xml new file mode 100644 index 00000000..15b8f8f7 --- /dev/null +++ b/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/src/main/resources/mapper_xml/TenantMapperEx.xml b/src/main/resources/mapper_xml/TenantMapperEx.xml new file mode 100644 index 00000000..20360213 --- /dev/null +++ b/src/main/resources/mapper_xml/TenantMapperEx.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper_xml/UnitMapper.xml b/src/main/resources/mapper_xml/UnitMapper.xml new file mode 100644 index 00000000..26ba79a1 --- /dev/null +++ b/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/src/main/resources/mapper_xml/UnitMapperEx.xml b/src/main/resources/mapper_xml/UnitMapperEx.xml new file mode 100644 index 00000000..f2491b0a --- /dev/null +++ b/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/src/main/resources/mapper_xml/UserBusinessMapper.xml b/src/main/resources/mapper_xml/UserBusinessMapper.xml new file mode 100644 index 00000000..e936d5d5 --- /dev/null +++ b/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/src/main/resources/mapper_xml/UserBusinessMapperEx.xml b/src/main/resources/mapper_xml/UserBusinessMapperEx.xml new file mode 100644 index 00000000..6baeb34c --- /dev/null +++ b/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/src/main/resources/mapper_xml/UserMapper.xml b/src/main/resources/mapper_xml/UserMapper.xml new file mode 100644 index 00000000..d08b823e --- /dev/null +++ b/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/src/main/resources/mapper_xml/UserMapperEx.xml b/src/main/resources/mapper_xml/UserMapperEx.xml new file mode 100644 index 00000000..6caa2f91 --- /dev/null +++ b/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/src/test/java/com/wansensoft/erp/Test.java b/src/test/java/com/wansensoft/erp/Test.java new file mode 100644 index 00000000..e2feea6f --- /dev/null +++ b/src/test/java/com/wansensoft/erp/Test.java @@ -0,0 +1,14 @@ +package com.wansensoft.erp; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class Test { + + public static void main(String args[]){ + Date date = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateString = formatter.format(date); + System.out.println(dateString); + } +} diff --git a/src/test/java/com/wansensoft/erp/ThreadPoolTest.java b/src/test/java/com/wansensoft/erp/ThreadPoolTest.java new file mode 100644 index 00000000..5ba6ba05 --- /dev/null +++ b/src/test/java/com/wansensoft/erp/ThreadPoolTest.java @@ -0,0 +1,66 @@ +package com.wansensoft.erp; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * 线程池测试案例 + */ +public class ThreadPoolTest { + + public static void main(String[] args) throws Exception { + // 开始时间 + long start = System.currentTimeMillis(); + List list = new ArrayList(); + for (int i = 1; i <= 3000; i++) { + list.add(i + ""); + } + // 每500条数据开启一条线程 + int threadSize = 500; + // 总数据条数 + int dataSize = list.size(); + // 线程数 + int threadNum = dataSize / threadSize + 1; + // 定义标记,过滤threadNum为整数 + boolean special = dataSize % threadSize == 0; + // 创建一个线程池 + ExecutorService exec = Executors.newFixedThreadPool(threadNum); + // 定义一个任务集合 + List> tasks = new ArrayList>(); + Callable task = null; + List cutList = null; + // 确定每条线程的数据 + for (int i = 0; i < threadNum; i++) { + if (i == threadNum - 1) { + if (special) { + break; + } + cutList = list.subList(threadSize * i, dataSize); + } else { + cutList = list.subList(threadSize * i, threadSize * (i + 1)); + } + final List listStr = cutList; + task = new Callable() { + @Override + public Integer call() throws Exception { + System.out.println(Thread.currentThread().getName() + "线程:" + listStr); + return 1; + } + }; + // 这里提交的任务容器列表和返回的Future列表存在顺序对应的关系 + tasks.add(task); + } + List> results = exec.invokeAll(tasks); + for (Future future : results) { + System.out.println(future.get()); + } + // 关闭线程池 + exec.shutdown(); + System.out.println("线程任务执行结束"); + System.err.println("执行任务消耗了 :" + (System.currentTimeMillis() - start) + "毫秒"); + } +} diff --git a/src/test/resources/generatorConfig.xml b/src/test/resources/generatorConfig.xml new file mode 100644 index 00000000..7df7ff8b --- /dev/null +++ b/src/test/resources/generatorConfig.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/pom.xml b/utils/pom.xml deleted file mode 100644 index a168f6db..00000000 --- a/utils/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - wansnenerp - wansentech - 0.0.1-SNAPSHOT - - jar - 4.0.0 - utils - - - 17 - 17 - - - - - - com.baomidou - mybatis-plus-boot-starter - 3.5.3 - - - com.baomidou - dynamic-datasource-spring-boot-starter - 3.4.1 - - - - javax.mail - javax.mail-api - 1.5.6 - - - com.sun.mail - javax.mail - 1.5.3 - - - - \ No newline at end of file diff --git a/utils/src/main/java/com/wansentech/Response.java b/utils/src/main/java/com/wansentech/Response.java deleted file mode 100644 index 371d69f3..00000000 --- a/utils/src/main/java/com/wansentech/Response.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.wansentech.enums.CodeEnum; - -import java.io.Serializable; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Response implements Serializable { - - private static final long serialVersionUID = 793034041048451317L; - - private String msg; - - private Integer 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(int 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(int 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 int getCode() { - return code; - } - - public void setCode(int 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/wansentech/SnowflakeIdUtil.java b/utils/src/main/java/com/wansentech/SnowflakeIdUtil.java deleted file mode 100644 index e7d80ced..00000000 --- a/utils/src/main/java/com/wansentech/SnowflakeIdUtil.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech; - -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/wansentech/enums/CodeEnum.java b/utils/src/main/java/com/wansentech/enums/CodeEnum.java deleted file mode 100644 index cf04d937..00000000 --- a/utils/src/main/java/com/wansentech/enums/CodeEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2023 wansentech.com, Inc. or its affiliates. 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. - */ -package com.wansentech.enums; -public enum CodeEnum { - - // 基本状态码 - SUCCESS(200, "成功"), - ERROR(500, "失败,服务器错误"), - - // 用户类代码 - REGISTER_SUCCESS(20001, "用户注册成功"), - USER_EXISTS(20002, "用户名已存在"); - - /** - * 响应状态码 - */ - private Integer code; - - /** - * 响应提示 - */ - private String msg; - - CodeEnum(int code, String msg) { - this.code = code; - this.msg = msg; - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } -}