Compare commits

...

No commits in common. 'main' and 'developVue' have entirely different histories.

28
.gitignore vendored

@ -0,0 +1,28 @@
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
target/
# Created by .ignore support plugin (hsz.mobi)
*.iml
*.iws
# out
**/out/
package-lock.json
yarn.lock

@ -0,0 +1,73 @@
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.

@ -0,0 +1,3 @@
# tobacco
烟草

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean
pause

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 打包Web工程生成war/jar包文件。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean package -Dmaven.test.skip=true
pause

@ -0,0 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>bs-jxc</artifactId>
<groupId>com.bs</groupId>
<version>3.8.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>bs-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.16</version>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.bs</groupId>
<artifactId>bs-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.bs</groupId>
<artifactId>bs-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.bs</groupId>
<artifactId>bs-generator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

@ -0,0 +1,21 @@
package com.bs;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
*
*
* @author bs
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class BsApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(BsApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 保税启动成功 ლ(´ڡ`ლ)゙ ");
}
}

@ -0,0 +1,18 @@
package com.bs;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web
*
* @author bs
*/
public class BsServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(BsApplication.class);
}
}

@ -0,0 +1,189 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtGalleryCata;
import com.bs.ct.service.ICtGalleryCataService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "图库目录")
@RestController
@RequestMapping("/gallery/cata")
public class CtGalleryCataController extends BaseController {
@Resource
private ICtGalleryCataService ctGalleryCataService;
/**
*
*/
@ApiOperation("分页查询图库目录列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtGalleryCata ctGalleryCata) {
startPage();
LambdaQueryWrapper<CtGalleryCata> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCata);
List<CtGalleryCata> list = ctGalleryCataService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询图库目录列表")
@GetMapping("/list")
public AjaxResult list(CtGalleryCata ctGalleryCata) {
LambdaQueryWrapper<CtGalleryCata> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCata);
List<CtGalleryCata> list = ctGalleryCataService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出图库目录列表")
@Log(title = "图库目录导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtGalleryCata ctGalleryCata) {
LambdaQueryWrapper<CtGalleryCata> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCata);
List<CtGalleryCata> list = ctGalleryCataService.list(queryWrapper);
ExcelUtil<CtGalleryCata> util = new ExcelUtil<CtGalleryCata>(CtGalleryCata. class);
util.exportExcel(response, list, "图库目录数据");
}
/**
*
*/
@ApiOperation("获取图库目录详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctGalleryCataService.getById(id));
}
/**
*
*/
@ApiOperation("新增图库目录")
@Log(title = "图库目录新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtGalleryCata ctGalleryCata) {
return toAjax(ctGalleryCataService.save(ctGalleryCata));
}
/**
*
*/
@ApiOperation("修改图库目录")
@Log(title = "图库目录修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtGalleryCata ctGalleryCata) {
return toAjax(ctGalleryCataService.updateById(ctGalleryCata));
}
/**
*
*/
@ApiOperation("删除图库目录")
@Log(title = "图库目录删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctGalleryCataService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtGalleryCata> queryWrapper,CtGalleryCata ctGalleryCata){
//id
if(Validator.isNotEmpty(ctGalleryCata.getId())){
queryWrapper.eq(CtGalleryCata::getId,ctGalleryCata.getId());
}
//目录名称
if(Validator.isNotEmpty(ctGalleryCata.getCataName())){
queryWrapper.eq(CtGalleryCata::getCataName,ctGalleryCata.getCataName());
}
//父级id
if(Validator.isNotEmpty(ctGalleryCata.getParentId())){
queryWrapper.eq(CtGalleryCata::getParentId,ctGalleryCata.getParentId());
}
//类型
if(Validator.isNotEmpty(ctGalleryCata.getType())){
queryWrapper.eq(CtGalleryCata::getType,ctGalleryCata.getType());
}
//备注
if(Validator.isNotEmpty(ctGalleryCata.getRemarks())){
queryWrapper.eq(CtGalleryCata::getRemarks,ctGalleryCata.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctGalleryCata.getDelFlag())){
queryWrapper.eq(CtGalleryCata::getDelFlag,ctGalleryCata.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctGalleryCata.getCreateDept())){
queryWrapper.eq(CtGalleryCata::getCreateDept,ctGalleryCata.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctGalleryCata.getCreateBy())){
queryWrapper.eq(CtGalleryCata::getCreateBy,ctGalleryCata.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctGalleryCata.getCreateTime())){
queryWrapper.eq(CtGalleryCata::getCreateTime,ctGalleryCata.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctGalleryCata.getUpdateBy())){
queryWrapper.eq(CtGalleryCata::getUpdateBy,ctGalleryCata.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctGalleryCata.getUpdateTime())){
queryWrapper.eq(CtGalleryCata::getUpdateTime,ctGalleryCata.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctGalleryCata.getTenantId())){
queryWrapper.eq(CtGalleryCata::getTenantId,ctGalleryCata.getTenantId());
}
}
}

@ -0,0 +1,199 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtGalleryCataShare;
import com.bs.ct.service.ICtGalleryCataShareService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "图库目录共享")
@RestController
@RequestMapping("/gallery/cata/share")
public class CtGalleryCataShareController extends BaseController {
@Resource
private ICtGalleryCataShareService ctGalleryCataShareService;
/**
*
*/
@ApiOperation("分页查询图库目录共享列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtGalleryCataShare ctGalleryCataShare) {
startPage();
LambdaQueryWrapper<CtGalleryCataShare> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCataShare);
List<CtGalleryCataShare> list = ctGalleryCataShareService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询图库目录共享列表")
@GetMapping("/list")
public AjaxResult list(CtGalleryCataShare ctGalleryCataShare) {
LambdaQueryWrapper<CtGalleryCataShare> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCataShare);
List<CtGalleryCataShare> list = ctGalleryCataShareService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出图库目录共享列表")
@Log(title = "图库目录共享导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtGalleryCataShare ctGalleryCataShare) {
LambdaQueryWrapper<CtGalleryCataShare> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryCataShare);
List<CtGalleryCataShare> list = ctGalleryCataShareService.list(queryWrapper);
ExcelUtil<CtGalleryCataShare> util = new ExcelUtil<CtGalleryCataShare>(CtGalleryCataShare. class);
util.exportExcel(response, list, "图库目录共享数据");
}
/**
*
*/
@ApiOperation("获取图库目录共享详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctGalleryCataShareService.getById(id));
}
/**
*
*/
@ApiOperation("新增图库目录共享")
@Log(title = "图库目录共享新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtGalleryCataShare ctGalleryCataShare) {
return toAjax(ctGalleryCataShareService.save(ctGalleryCataShare));
}
/**
*
*/
@ApiOperation("修改图库目录共享")
@Log(title = "图库目录共享修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtGalleryCataShare ctGalleryCataShare) {
return toAjax(ctGalleryCataShareService.updateById(ctGalleryCataShare));
}
/**
*
*/
@ApiOperation("删除图库目录共享")
@Log(title = "图库目录共享删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctGalleryCataShareService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtGalleryCataShare> queryWrapper,CtGalleryCataShare ctGalleryCataShare){
//id
if(Validator.isNotEmpty(ctGalleryCataShare.getId())){
queryWrapper.eq(CtGalleryCataShare::getId,ctGalleryCataShare.getId());
}
//共享类型目录共享、图片共享
if(Validator.isNotEmpty(ctGalleryCataShare.getType())){
queryWrapper.eq(CtGalleryCataShare::getType,ctGalleryCataShare.getType());
}
//目录id
if(Validator.isNotEmpty(ctGalleryCataShare.getCataId())){
queryWrapper.eq(CtGalleryCataShare::getCataId,ctGalleryCataShare.getCataId());
}
//共享用户
if(Validator.isNotEmpty(ctGalleryCataShare.getUserId())){
queryWrapper.eq(CtGalleryCataShare::getUserId,ctGalleryCataShare.getUserId());
}
//开始时间
if(Validator.isNotEmpty(ctGalleryCataShare.getBeginDate())){
queryWrapper.eq(CtGalleryCataShare::getBeginDate,ctGalleryCataShare.getBeginDate());
}
//结束时间
if(Validator.isNotEmpty(ctGalleryCataShare.getEndDate())){
queryWrapper.eq(CtGalleryCataShare::getEndDate,ctGalleryCataShare.getEndDate());
}
//备注
if(Validator.isNotEmpty(ctGalleryCataShare.getRemarks())){
queryWrapper.eq(CtGalleryCataShare::getRemarks,ctGalleryCataShare.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctGalleryCataShare.getDelFlag())){
queryWrapper.eq(CtGalleryCataShare::getDelFlag,ctGalleryCataShare.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctGalleryCataShare.getCreateDept())){
queryWrapper.eq(CtGalleryCataShare::getCreateDept,ctGalleryCataShare.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctGalleryCataShare.getCreateBy())){
queryWrapper.eq(CtGalleryCataShare::getCreateBy,ctGalleryCataShare.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctGalleryCataShare.getCreateTime())){
queryWrapper.eq(CtGalleryCataShare::getCreateTime,ctGalleryCataShare.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctGalleryCataShare.getUpdateBy())){
queryWrapper.eq(CtGalleryCataShare::getUpdateBy,ctGalleryCataShare.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctGalleryCataShare.getUpdateTime())){
queryWrapper.eq(CtGalleryCataShare::getUpdateTime,ctGalleryCataShare.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctGalleryCataShare.getTenantId())){
queryWrapper.eq(CtGalleryCataShare::getTenantId,ctGalleryCataShare.getTenantId());
}
}
}

@ -0,0 +1,224 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtGalleryImages;
import com.bs.ct.service.ICtGalleryImagesService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "图库图片")
@RestController
@RequestMapping("/gallery/images")
public class CtGalleryImagesController extends BaseController {
@Resource
private ICtGalleryImagesService ctGalleryImagesService;
/**
*
*/
@ApiOperation("分页查询图库图片列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtGalleryImages ctGalleryImages) {
startPage();
LambdaQueryWrapper<CtGalleryImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImages);
List<CtGalleryImages> list = ctGalleryImagesService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询图库图片列表")
@GetMapping("/list")
public AjaxResult list(CtGalleryImages ctGalleryImages) {
LambdaQueryWrapper<CtGalleryImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImages);
List<CtGalleryImages> list = ctGalleryImagesService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出图库图片列表")
@Log(title = "图库图片导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtGalleryImages ctGalleryImages) {
LambdaQueryWrapper<CtGalleryImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImages);
List<CtGalleryImages> list = ctGalleryImagesService.list(queryWrapper);
ExcelUtil<CtGalleryImages> util = new ExcelUtil<CtGalleryImages>(CtGalleryImages. class);
util.exportExcel(response, list, "图库图片数据");
}
/**
*
*/
@ApiOperation("获取图库图片详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctGalleryImagesService.getById(id));
}
/**
*
*/
@ApiOperation("新增图库图片")
@Log(title = "图库图片新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtGalleryImages ctGalleryImages) {
return toAjax(ctGalleryImagesService.save(ctGalleryImages));
}
/**
*
*/
@ApiOperation("修改图库图片")
@Log(title = "图库图片修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtGalleryImages ctGalleryImages) {
return toAjax(ctGalleryImagesService.updateById(ctGalleryImages));
}
/**
*
*/
@ApiOperation("删除图库图片")
@Log(title = "图库图片删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctGalleryImagesService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtGalleryImages> queryWrapper,CtGalleryImages ctGalleryImages){
//id
if(Validator.isNotEmpty(ctGalleryImages.getId())){
queryWrapper.eq(CtGalleryImages::getId,ctGalleryImages.getId());
}
//目录id
if(Validator.isNotEmpty(ctGalleryImages.getCataId())){
queryWrapper.eq(CtGalleryImages::getCataId,ctGalleryImages.getCataId());
}
//图片名称
if(Validator.isNotEmpty(ctGalleryImages.getImageName())){
queryWrapper.eq(CtGalleryImages::getImageName,ctGalleryImages.getImageName());
}
//图片标题
if(Validator.isNotEmpty(ctGalleryImages.getImageTitle())){
queryWrapper.eq(CtGalleryImages::getImageTitle,ctGalleryImages.getImageTitle());
}
//图片路径
if(Validator.isNotEmpty(ctGalleryImages.getImagePath())){
queryWrapper.eq(CtGalleryImages::getImagePath,ctGalleryImages.getImagePath());
}
//图片大小
if(Validator.isNotEmpty(ctGalleryImages.getImageSize())){
queryWrapper.eq(CtGalleryImages::getImageSize,ctGalleryImages.getImageSize());
}
//图片拍摄时间
if(Validator.isNotEmpty(ctGalleryImages.getPhotoTime())){
queryWrapper.eq(CtGalleryImages::getPhotoTime,ctGalleryImages.getPhotoTime());
}
//图片上传时间
if(Validator.isNotEmpty(ctGalleryImages.getUploadTime())){
queryWrapper.eq(CtGalleryImages::getUploadTime,ctGalleryImages.getUploadTime());
}
//是否公开
if(Validator.isNotEmpty(ctGalleryImages.getIsOpen())){
queryWrapper.eq(CtGalleryImages::getIsOpen,ctGalleryImages.getIsOpen());
}
//图片关键字
if(Validator.isNotEmpty(ctGalleryImages.getKeyWords())){
queryWrapper.eq(CtGalleryImages::getKeyWords,ctGalleryImages.getKeyWords());
}
//附件id
if(Validator.isNotEmpty(ctGalleryImages.getFileId())){
queryWrapper.eq(CtGalleryImages::getFileId,ctGalleryImages.getFileId());
}
//备注
if(Validator.isNotEmpty(ctGalleryImages.getRemarks())){
queryWrapper.eq(CtGalleryImages::getRemarks,ctGalleryImages.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctGalleryImages.getDelFlag())){
queryWrapper.eq(CtGalleryImages::getDelFlag,ctGalleryImages.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctGalleryImages.getCreateDept())){
queryWrapper.eq(CtGalleryImages::getCreateDept,ctGalleryImages.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctGalleryImages.getCreateBy())){
queryWrapper.eq(CtGalleryImages::getCreateBy,ctGalleryImages.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctGalleryImages.getCreateTime())){
queryWrapper.eq(CtGalleryImages::getCreateTime,ctGalleryImages.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctGalleryImages.getUpdateBy())){
queryWrapper.eq(CtGalleryImages::getUpdateBy,ctGalleryImages.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctGalleryImages.getUpdateTime())){
queryWrapper.eq(CtGalleryImages::getUpdateTime,ctGalleryImages.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctGalleryImages.getTenantId())){
queryWrapper.eq(CtGalleryImages::getTenantId,ctGalleryImages.getTenantId());
}
}
}

@ -0,0 +1,184 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtGalleryImagesTag;
import com.bs.ct.service.ICtGalleryImagesTagService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "图库图片标签")
@RestController
@RequestMapping("/gallery/images/tag")
public class CtGalleryImagesTagController extends BaseController {
@Resource
private ICtGalleryImagesTagService ctGalleryImagesTagService;
/**
*
*/
@ApiOperation("分页查询图库图片标签列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtGalleryImagesTag ctGalleryImagesTag) {
startPage();
LambdaQueryWrapper<CtGalleryImagesTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImagesTag);
List<CtGalleryImagesTag> list = ctGalleryImagesTagService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询图库图片标签列表")
@GetMapping("/list")
public AjaxResult list(CtGalleryImagesTag ctGalleryImagesTag) {
LambdaQueryWrapper<CtGalleryImagesTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImagesTag);
List<CtGalleryImagesTag> list = ctGalleryImagesTagService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出图库图片标签列表")
@Log(title = "图库图片标签导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtGalleryImagesTag ctGalleryImagesTag) {
LambdaQueryWrapper<CtGalleryImagesTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctGalleryImagesTag);
List<CtGalleryImagesTag> list = ctGalleryImagesTagService.list(queryWrapper);
ExcelUtil<CtGalleryImagesTag> util = new ExcelUtil<CtGalleryImagesTag>(CtGalleryImagesTag. class);
util.exportExcel(response, list, "图库图片标签数据");
}
/**
*
*/
@ApiOperation("获取图库图片标签详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctGalleryImagesTagService.getById(id));
}
/**
*
*/
@ApiOperation("新增图库图片标签")
@Log(title = "图库图片标签新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtGalleryImagesTag ctGalleryImagesTag) {
return toAjax(ctGalleryImagesTagService.save(ctGalleryImagesTag));
}
/**
*
*/
@ApiOperation("修改图库图片标签")
@Log(title = "图库图片标签修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtGalleryImagesTag ctGalleryImagesTag) {
return toAjax(ctGalleryImagesTagService.updateById(ctGalleryImagesTag));
}
/**
*
*/
@ApiOperation("删除图库图片标签")
@Log(title = "图库图片标签删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctGalleryImagesTagService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtGalleryImagesTag> queryWrapper,CtGalleryImagesTag ctGalleryImagesTag){
//id
if(Validator.isNotEmpty(ctGalleryImagesTag.getId())){
queryWrapper.eq(CtGalleryImagesTag::getId,ctGalleryImagesTag.getId());
}
//图片id
if(Validator.isNotEmpty(ctGalleryImagesTag.getImageId())){
queryWrapper.eq(CtGalleryImagesTag::getImageId,ctGalleryImagesTag.getImageId());
}
//标签名称
if(Validator.isNotEmpty(ctGalleryImagesTag.getTagName())){
queryWrapper.eq(CtGalleryImagesTag::getTagName,ctGalleryImagesTag.getTagName());
}
//备注
if(Validator.isNotEmpty(ctGalleryImagesTag.getRemarks())){
queryWrapper.eq(CtGalleryImagesTag::getRemarks,ctGalleryImagesTag.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctGalleryImagesTag.getDelFlag())){
queryWrapper.eq(CtGalleryImagesTag::getDelFlag,ctGalleryImagesTag.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctGalleryImagesTag.getCreateDept())){
queryWrapper.eq(CtGalleryImagesTag::getCreateDept,ctGalleryImagesTag.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctGalleryImagesTag.getCreateBy())){
queryWrapper.eq(CtGalleryImagesTag::getCreateBy,ctGalleryImagesTag.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctGalleryImagesTag.getCreateTime())){
queryWrapper.eq(CtGalleryImagesTag::getCreateTime,ctGalleryImagesTag.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctGalleryImagesTag.getUpdateBy())){
queryWrapper.eq(CtGalleryImagesTag::getUpdateBy,ctGalleryImagesTag.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctGalleryImagesTag.getUpdateTime())){
queryWrapper.eq(CtGalleryImagesTag::getUpdateTime,ctGalleryImagesTag.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctGalleryImagesTag.getTenantId())){
queryWrapper.eq(CtGalleryImagesTag::getTenantId,ctGalleryImagesTag.getTenantId());
}
}
}

@ -0,0 +1,204 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTag;
import com.bs.ct.service.ICtTagService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "标签信息")
@RestController
@RequestMapping("/system/tag")
public class CtTagController extends BaseController {
@Resource
private ICtTagService ctTagService;
/**
*
*/
@ApiOperation("分页查询标签信息列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTag ctTag) {
startPage();
LambdaQueryWrapper<CtTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTag);
List<CtTag> list = ctTagService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询标签信息列表")
@GetMapping("/list")
public AjaxResult list(CtTag ctTag) {
LambdaQueryWrapper<CtTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTag);
List<CtTag> list = ctTagService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出标签信息列表")
@Log(title = "标签信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTag ctTag) {
LambdaQueryWrapper<CtTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTag);
List<CtTag> list = ctTagService.list(queryWrapper);
ExcelUtil<CtTag> util = new ExcelUtil<CtTag>(CtTag. class);
util.exportExcel(response, list, "标签信息数据");
}
/**
*
*/
@ApiOperation("获取标签信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTagService.getById(id));
}
/**
*
*/
@ApiOperation("新增标签信息")
@Log(title = "标签信息新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTag ctTag) {
return toAjax(ctTagService.save(ctTag));
}
/**
*
*/
@ApiOperation("修改标签信息")
@Log(title = "标签信息修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTag ctTag) {
return toAjax(ctTagService.updateById(ctTag));
}
/**
*
*/
@ApiOperation("删除标签信息")
@Log(title = "标签信息删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTagService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTag> queryWrapper,CtTag ctTag){
//id
if(Validator.isNotEmpty(ctTag.getId())){
queryWrapper.eq(CtTag::getId,ctTag.getId());
}
//标签名称
if(Validator.isNotEmpty(ctTag.getTagName())){
queryWrapper.eq(CtTag::getTagName,ctTag.getTagName());
}
//标签说明
if(Validator.isNotEmpty(ctTag.getTagDesc())){
queryWrapper.eq(CtTag::getTagDesc,ctTag.getTagDesc());
}
//是否需要拍照
if(Validator.isNotEmpty(ctTag.getIsPhoto())){
queryWrapper.eq(CtTag::getIsPhoto,ctTag.getIsPhoto());
}
//拍照数量要求
if(Validator.isNotEmpty(ctTag.getPhotoNum())){
queryWrapper.eq(CtTag::getPhotoNum,ctTag.getPhotoNum());
}
//照片存放目录
if(Validator.isNotEmpty(ctTag.getSaveDir())){
queryWrapper.eq(CtTag::getSaveDir,ctTag.getSaveDir());
}
//附件id
if(Validator.isNotEmpty(ctTag.getFileId())){
queryWrapper.eq(CtTag::getFileId,ctTag.getFileId());
}
//备注
if(Validator.isNotEmpty(ctTag.getRemarks())){
queryWrapper.eq(CtTag::getRemarks,ctTag.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTag.getDelFlag())){
queryWrapper.eq(CtTag::getDelFlag,ctTag.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTag.getCreateDept())){
queryWrapper.eq(CtTag::getCreateDept,ctTag.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTag.getCreateBy())){
queryWrapper.eq(CtTag::getCreateBy,ctTag.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTag.getCreateTime())){
queryWrapper.eq(CtTag::getCreateTime,ctTag.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTag.getUpdateBy())){
queryWrapper.eq(CtTag::getUpdateBy,ctTag.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTag.getUpdateTime())){
queryWrapper.eq(CtTag::getUpdateTime,ctTag.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTag.getTenantId())){
queryWrapper.eq(CtTag::getTenantId,ctTag.getTenantId());
}
}
}

@ -0,0 +1,199 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskBranch;
import com.bs.ct.service.ICtTaskBranchService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务机构信息")
@RestController
@RequestMapping("/task/branch")
public class CtTaskBranchController extends BaseController {
@Resource
private ICtTaskBranchService ctTaskBranchService;
/**
*
*/
@ApiOperation("分页查询任务机构信息列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskBranch ctTaskBranch) {
startPage();
LambdaQueryWrapper<CtTaskBranch> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskBranch);
List<CtTaskBranch> list = ctTaskBranchService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务机构信息列表")
@GetMapping("/list")
public AjaxResult list(CtTaskBranch ctTaskBranch) {
LambdaQueryWrapper<CtTaskBranch> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskBranch);
List<CtTaskBranch> list = ctTaskBranchService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务机构信息列表")
@Log(title = "任务机构信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskBranch ctTaskBranch) {
LambdaQueryWrapper<CtTaskBranch> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskBranch);
List<CtTaskBranch> list = ctTaskBranchService.list(queryWrapper);
ExcelUtil<CtTaskBranch> util = new ExcelUtil<CtTaskBranch>(CtTaskBranch. class);
util.exportExcel(response, list, "任务机构信息数据");
}
/**
*
*/
@ApiOperation("获取任务机构信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskBranchService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务机构信息")
@Log(title = "任务机构信息新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskBranch ctTaskBranch) {
return toAjax(ctTaskBranchService.save(ctTaskBranch));
}
/**
*
*/
@ApiOperation("修改任务机构信息")
@Log(title = "任务机构信息修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskBranch ctTaskBranch) {
return toAjax(ctTaskBranchService.updateById(ctTaskBranch));
}
/**
*
*/
@ApiOperation("删除任务机构信息")
@Log(title = "任务机构信息删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskBranchService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskBranch> queryWrapper,CtTaskBranch ctTaskBranch){
//id
if(Validator.isNotEmpty(ctTaskBranch.getId())){
queryWrapper.eq(CtTaskBranch::getId,ctTaskBranch.getId());
}
//任务id
if(Validator.isNotEmpty(ctTaskBranch.getTaskId())){
queryWrapper.eq(CtTaskBranch::getTaskId,ctTaskBranch.getTaskId());
}
//类型人员、机构
if(Validator.isNotEmpty(ctTaskBranch.getType())){
queryWrapper.eq(CtTaskBranch::getType,ctTaskBranch.getType());
}
//机构代码
if(Validator.isNotEmpty(ctTaskBranch.getBranchCode())){
queryWrapper.eq(CtTaskBranch::getBranchCode,ctTaskBranch.getBranchCode());
}
//机构名称
if(Validator.isNotEmpty(ctTaskBranch.getBranchName())){
queryWrapper.eq(CtTaskBranch::getBranchName,ctTaskBranch.getBranchName());
}
//任务状态
if(Validator.isNotEmpty(ctTaskBranch.getTaskStatus())){
queryWrapper.eq(CtTaskBranch::getTaskStatus,ctTaskBranch.getTaskStatus());
}
//备注
if(Validator.isNotEmpty(ctTaskBranch.getRemarks())){
queryWrapper.eq(CtTaskBranch::getRemarks,ctTaskBranch.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskBranch.getDelFlag())){
queryWrapper.eq(CtTaskBranch::getDelFlag,ctTaskBranch.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskBranch.getCreateDept())){
queryWrapper.eq(CtTaskBranch::getCreateDept,ctTaskBranch.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskBranch.getCreateBy())){
queryWrapper.eq(CtTaskBranch::getCreateBy,ctTaskBranch.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskBranch.getCreateTime())){
queryWrapper.eq(CtTaskBranch::getCreateTime,ctTaskBranch.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskBranch.getUpdateBy())){
queryWrapper.eq(CtTaskBranch::getUpdateBy,ctTaskBranch.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskBranch.getUpdateTime())){
queryWrapper.eq(CtTaskBranch::getUpdateTime,ctTaskBranch.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskBranch.getTenantId())){
queryWrapper.eq(CtTaskBranch::getTenantId,ctTaskBranch.getTenantId());
}
}
}

@ -0,0 +1,254 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskFeedback;
import com.bs.ct.service.ICtTaskFeedbackService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务反馈")
@RestController
@RequestMapping("/task/feedback")
public class CtTaskFeedbackController extends BaseController {
@Resource
private ICtTaskFeedbackService ctTaskFeedbackService;
/**
*
*/
@ApiOperation("分页查询任务反馈列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskFeedback ctTaskFeedback) {
startPage();
LambdaQueryWrapper<CtTaskFeedback> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskFeedback);
List<CtTaskFeedback> list = ctTaskFeedbackService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务反馈列表")
@GetMapping("/list")
public AjaxResult list(CtTaskFeedback ctTaskFeedback) {
LambdaQueryWrapper<CtTaskFeedback> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskFeedback);
List<CtTaskFeedback> list = ctTaskFeedbackService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务反馈列表")
@Log(title = "任务反馈导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskFeedback ctTaskFeedback) {
LambdaQueryWrapper<CtTaskFeedback> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskFeedback);
List<CtTaskFeedback> list = ctTaskFeedbackService.list(queryWrapper);
ExcelUtil<CtTaskFeedback> util = new ExcelUtil<CtTaskFeedback>(CtTaskFeedback. class);
util.exportExcel(response, list, "任务反馈数据");
}
/**
*
*/
@ApiOperation("获取任务反馈详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskFeedbackService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务反馈")
@Log(title = "任务反馈新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskFeedback ctTaskFeedback) {
return toAjax(ctTaskFeedbackService.save(ctTaskFeedback));
}
/**
*
*/
@ApiOperation("修改任务反馈")
@Log(title = "任务反馈修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskFeedback ctTaskFeedback) {
return toAjax(ctTaskFeedbackService.updateById(ctTaskFeedback));
}
/**
*
*/
@ApiOperation("删除任务反馈")
@Log(title = "任务反馈删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskFeedbackService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskFeedback> queryWrapper,CtTaskFeedback ctTaskFeedback){
//id
if(Validator.isNotEmpty(ctTaskFeedback.getId())){
queryWrapper.eq(CtTaskFeedback::getId,ctTaskFeedback.getId());
}
//任务id
if(Validator.isNotEmpty(ctTaskFeedback.getTaskId())){
queryWrapper.eq(CtTaskFeedback::getTaskId,ctTaskFeedback.getTaskId());
}
//机构任务id
if(Validator.isNotEmpty(ctTaskFeedback.getTaskBranchId())){
queryWrapper.eq(CtTaskFeedback::getTaskBranchId,ctTaskFeedback.getTaskBranchId());
}
//机构代码
if(Validator.isNotEmpty(ctTaskFeedback.getBranchCode())){
queryWrapper.eq(CtTaskFeedback::getBranchCode,ctTaskFeedback.getBranchCode());
}
//任务反馈时间
if(Validator.isNotEmpty(ctTaskFeedback.getFeedbackTime())){
queryWrapper.eq(CtTaskFeedback::getFeedbackTime,ctTaskFeedback.getFeedbackTime());
}
//任务完成情况
if(Validator.isNotEmpty(ctTaskFeedback.getTaskDesc())){
queryWrapper.eq(CtTaskFeedback::getTaskDesc,ctTaskFeedback.getTaskDesc());
}
//操作人员工号
if(Validator.isNotEmpty(ctTaskFeedback.getUserId())){
queryWrapper.eq(CtTaskFeedback::getUserId,ctTaskFeedback.getUserId());
}
//操作人员姓名
if(Validator.isNotEmpty(ctTaskFeedback.getUserName())){
queryWrapper.eq(CtTaskFeedback::getUserName,ctTaskFeedback.getUserName());
}
//操作人员部门
if(Validator.isNotEmpty(ctTaskFeedback.getUserDept())){
queryWrapper.eq(CtTaskFeedback::getUserDept,ctTaskFeedback.getUserDept());
}
//是否已拍照留存
if(Validator.isNotEmpty(ctTaskFeedback.getIsPhoto())){
queryWrapper.eq(CtTaskFeedback::getIsPhoto,ctTaskFeedback.getIsPhoto());
}
//附件id
if(Validator.isNotEmpty(ctTaskFeedback.getFileId())){
queryWrapper.eq(CtTaskFeedback::getFileId,ctTaskFeedback.getFileId());
}
//审核人员id
if(Validator.isNotEmpty(ctTaskFeedback.getCheckUserId())){
queryWrapper.eq(CtTaskFeedback::getCheckUserId,ctTaskFeedback.getCheckUserId());
}
//审核人员姓名
if(Validator.isNotEmpty(ctTaskFeedback.getCheckUserName())){
queryWrapper.eq(CtTaskFeedback::getCheckUserName,ctTaskFeedback.getCheckUserName());
}
//审核人员部门
if(Validator.isNotEmpty(ctTaskFeedback.getCheckUserDept())){
queryWrapper.eq(CtTaskFeedback::getCheckUserDept,ctTaskFeedback.getCheckUserDept());
}
//审核时间
if(Validator.isNotEmpty(ctTaskFeedback.getCheckDate())){
queryWrapper.eq(CtTaskFeedback::getCheckDate,ctTaskFeedback.getCheckDate());
}
//审核状态
if(Validator.isNotEmpty(ctTaskFeedback.getStatus())){
queryWrapper.eq(CtTaskFeedback::getStatus,ctTaskFeedback.getStatus());
}
//审核信息
if(Validator.isNotEmpty(ctTaskFeedback.getCheckInfo())){
queryWrapper.eq(CtTaskFeedback::getCheckInfo,ctTaskFeedback.getCheckInfo());
}
//备注
if(Validator.isNotEmpty(ctTaskFeedback.getRemarks())){
queryWrapper.eq(CtTaskFeedback::getRemarks,ctTaskFeedback.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskFeedback.getDelFlag())){
queryWrapper.eq(CtTaskFeedback::getDelFlag,ctTaskFeedback.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskFeedback.getCreateDept())){
queryWrapper.eq(CtTaskFeedback::getCreateDept,ctTaskFeedback.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskFeedback.getCreateBy())){
queryWrapper.eq(CtTaskFeedback::getCreateBy,ctTaskFeedback.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskFeedback.getCreateTime())){
queryWrapper.eq(CtTaskFeedback::getCreateTime,ctTaskFeedback.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskFeedback.getUpdateBy())){
queryWrapper.eq(CtTaskFeedback::getUpdateBy,ctTaskFeedback.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskFeedback.getUpdateTime())){
queryWrapper.eq(CtTaskFeedback::getUpdateTime,ctTaskFeedback.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskFeedback.getTenantId())){
queryWrapper.eq(CtTaskFeedback::getTenantId,ctTaskFeedback.getTenantId());
}
}
}

@ -0,0 +1,184 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskImages;
import com.bs.ct.service.ICtTaskImagesService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务图片信息")
@RestController
@RequestMapping("/task/images")
public class CtTaskImagesController extends BaseController {
@Resource
private ICtTaskImagesService ctTaskImagesService;
/**
*
*/
@ApiOperation("分页查询任务图片信息列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskImages ctTaskImages) {
startPage();
LambdaQueryWrapper<CtTaskImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskImages);
List<CtTaskImages> list = ctTaskImagesService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务图片信息列表")
@GetMapping("/list")
public AjaxResult list(CtTaskImages ctTaskImages) {
LambdaQueryWrapper<CtTaskImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskImages);
List<CtTaskImages> list = ctTaskImagesService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务图片信息列表")
@Log(title = "任务图片信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskImages ctTaskImages) {
LambdaQueryWrapper<CtTaskImages> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskImages);
List<CtTaskImages> list = ctTaskImagesService.list(queryWrapper);
ExcelUtil<CtTaskImages> util = new ExcelUtil<CtTaskImages>(CtTaskImages. class);
util.exportExcel(response, list, "任务图片信息数据");
}
/**
*
*/
@ApiOperation("获取任务图片信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskImagesService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务图片信息")
@Log(title = "任务图片信息新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskImages ctTaskImages) {
return toAjax(ctTaskImagesService.save(ctTaskImages));
}
/**
*
*/
@ApiOperation("修改任务图片信息")
@Log(title = "任务图片信息修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskImages ctTaskImages) {
return toAjax(ctTaskImagesService.updateById(ctTaskImages));
}
/**
*
*/
@ApiOperation("删除任务图片信息")
@Log(title = "任务图片信息删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskImagesService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskImages> queryWrapper,CtTaskImages ctTaskImages){
//id
if(Validator.isNotEmpty(ctTaskImages.getId())){
queryWrapper.eq(CtTaskImages::getId,ctTaskImages.getId());
}
//任务id
if(Validator.isNotEmpty(ctTaskImages.getTaskId())){
queryWrapper.eq(CtTaskImages::getTaskId,ctTaskImages.getTaskId());
}
//图片id
if(Validator.isNotEmpty(ctTaskImages.getImageId())){
queryWrapper.eq(CtTaskImages::getImageId,ctTaskImages.getImageId());
}
//备注
if(Validator.isNotEmpty(ctTaskImages.getRemarks())){
queryWrapper.eq(CtTaskImages::getRemarks,ctTaskImages.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskImages.getDelFlag())){
queryWrapper.eq(CtTaskImages::getDelFlag,ctTaskImages.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskImages.getCreateDept())){
queryWrapper.eq(CtTaskImages::getCreateDept,ctTaskImages.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskImages.getCreateBy())){
queryWrapper.eq(CtTaskImages::getCreateBy,ctTaskImages.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskImages.getCreateTime())){
queryWrapper.eq(CtTaskImages::getCreateTime,ctTaskImages.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskImages.getUpdateBy())){
queryWrapper.eq(CtTaskImages::getUpdateBy,ctTaskImages.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskImages.getUpdateTime())){
queryWrapper.eq(CtTaskImages::getUpdateTime,ctTaskImages.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskImages.getTenantId())){
queryWrapper.eq(CtTaskImages::getTenantId,ctTaskImages.getTenantId());
}
}
}

@ -0,0 +1,239 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskInfo;
import com.bs.ct.service.ICtTaskInfoService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务信息")
@RestController
@RequestMapping("/task/info")
public class CtTaskInfoController extends BaseController {
@Resource
private ICtTaskInfoService ctTaskInfoService;
/**
*
*/
@ApiOperation("分页查询任务信息列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskInfo ctTaskInfo) {
startPage();
LambdaQueryWrapper<CtTaskInfo> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskInfo);
List<CtTaskInfo> list = ctTaskInfoService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务信息列表")
@GetMapping("/list")
public AjaxResult list(CtTaskInfo ctTaskInfo) {
LambdaQueryWrapper<CtTaskInfo> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskInfo);
List<CtTaskInfo> list = ctTaskInfoService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务信息列表")
@Log(title = "任务信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskInfo ctTaskInfo) {
LambdaQueryWrapper<CtTaskInfo> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskInfo);
List<CtTaskInfo> list = ctTaskInfoService.list(queryWrapper);
ExcelUtil<CtTaskInfo> util = new ExcelUtil<CtTaskInfo>(CtTaskInfo. class);
util.exportExcel(response, list, "任务信息数据");
}
/**
*
*/
@ApiOperation("获取任务信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskInfoService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务信息")
@Log(title = "任务信息新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskInfo ctTaskInfo) {
return toAjax(ctTaskInfoService.save(ctTaskInfo));
}
/**
*
*/
@ApiOperation("修改任务信息")
@Log(title = "任务信息修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskInfo ctTaskInfo) {
return toAjax(ctTaskInfoService.updateById(ctTaskInfo));
}
/**
*
*/
@ApiOperation("删除任务信息")
@Log(title = "任务信息删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskInfoService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskInfo> queryWrapper,CtTaskInfo ctTaskInfo){
//id
if(Validator.isNotEmpty(ctTaskInfo.getId())){
queryWrapper.eq(CtTaskInfo::getId,ctTaskInfo.getId());
}
//任务类型
if(Validator.isNotEmpty(ctTaskInfo.getTaskType())){
queryWrapper.eq(CtTaskInfo::getTaskType,ctTaskInfo.getTaskType());
}
//任务标题
if(Validator.isNotEmpty(ctTaskInfo.getTaskTitle())){
queryWrapper.eq(CtTaskInfo::getTaskTitle,ctTaskInfo.getTaskTitle());
}
//任务编号
if(Validator.isNotEmpty(ctTaskInfo.getTaskCode())){
queryWrapper.eq(CtTaskInfo::getTaskCode,ctTaskInfo.getTaskCode());
}
//开始时间
if(Validator.isNotEmpty(ctTaskInfo.getStartDate())){
queryWrapper.eq(CtTaskInfo::getStartDate,ctTaskInfo.getStartDate());
}
//结束时间
if(Validator.isNotEmpty(ctTaskInfo.getEndDate())){
queryWrapper.eq(CtTaskInfo::getEndDate,ctTaskInfo.getEndDate());
}
//任务要求
if(Validator.isNotEmpty(ctTaskInfo.getTaskContent())){
queryWrapper.eq(CtTaskInfo::getTaskContent,ctTaskInfo.getTaskContent());
}
//完成状态
if(Validator.isNotEmpty(ctTaskInfo.getStatus())){
queryWrapper.eq(CtTaskInfo::getStatus,ctTaskInfo.getStatus());
}
//附件id
if(Validator.isNotEmpty(ctTaskInfo.getFileId())){
queryWrapper.eq(CtTaskInfo::getFileId,ctTaskInfo.getFileId());
}
//任务发起人
if(Validator.isNotEmpty(ctTaskInfo.getTaskInitiator())){
queryWrapper.eq(CtTaskInfo::getTaskInitiator,ctTaskInfo.getTaskInitiator());
}
//任务发起单位机构代码
if(Validator.isNotEmpty(ctTaskInfo.getBranchCode())){
queryWrapper.eq(CtTaskInfo::getBranchCode,ctTaskInfo.getBranchCode());
}
//任务发起单位
if(Validator.isNotEmpty(ctTaskInfo.getBranchName())){
queryWrapper.eq(CtTaskInfo::getBranchName,ctTaskInfo.getBranchName());
}
//任务发起部门
if(Validator.isNotEmpty(ctTaskInfo.getDeptId())){
queryWrapper.eq(CtTaskInfo::getDeptId,ctTaskInfo.getDeptId());
}
//任务发布日期
if(Validator.isNotEmpty(ctTaskInfo.getTaskDate())){
queryWrapper.eq(CtTaskInfo::getTaskDate,ctTaskInfo.getTaskDate());
}
//备注
if(Validator.isNotEmpty(ctTaskInfo.getRemarks())){
queryWrapper.eq(CtTaskInfo::getRemarks,ctTaskInfo.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskInfo.getDelFlag())){
queryWrapper.eq(CtTaskInfo::getDelFlag,ctTaskInfo.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskInfo.getCreateDept())){
queryWrapper.eq(CtTaskInfo::getCreateDept,ctTaskInfo.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskInfo.getCreateBy())){
queryWrapper.eq(CtTaskInfo::getCreateBy,ctTaskInfo.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskInfo.getCreateTime())){
queryWrapper.eq(CtTaskInfo::getCreateTime,ctTaskInfo.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskInfo.getUpdateBy())){
queryWrapper.eq(CtTaskInfo::getUpdateBy,ctTaskInfo.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskInfo.getUpdateTime())){
queryWrapper.eq(CtTaskInfo::getUpdateTime,ctTaskInfo.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskInfo.getTenantId())){
queryWrapper.eq(CtTaskInfo::getTenantId,ctTaskInfo.getTenantId());
}
}
}

@ -0,0 +1,209 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskTag;
import com.bs.ct.service.ICtTaskTagService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务标签")
@RestController
@RequestMapping("/task/tag")
public class CtTaskTagController extends BaseController {
@Resource
private ICtTaskTagService ctTaskTagService;
/**
*
*/
@ApiOperation("分页查询任务标签列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskTag ctTaskTag) {
startPage();
LambdaQueryWrapper<CtTaskTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTag);
List<CtTaskTag> list = ctTaskTagService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务标签列表")
@GetMapping("/list")
public AjaxResult list(CtTaskTag ctTaskTag) {
LambdaQueryWrapper<CtTaskTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTag);
List<CtTaskTag> list = ctTaskTagService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务标签列表")
@Log(title = "任务标签导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskTag ctTaskTag) {
LambdaQueryWrapper<CtTaskTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTag);
List<CtTaskTag> list = ctTaskTagService.list(queryWrapper);
ExcelUtil<CtTaskTag> util = new ExcelUtil<CtTaskTag>(CtTaskTag. class);
util.exportExcel(response, list, "任务标签数据");
}
/**
*
*/
@ApiOperation("获取任务标签详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskTagService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务标签")
@Log(title = "任务标签新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskTag ctTaskTag) {
return toAjax(ctTaskTagService.save(ctTaskTag));
}
/**
*
*/
@ApiOperation("修改任务标签")
@Log(title = "任务标签修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskTag ctTaskTag) {
return toAjax(ctTaskTagService.updateById(ctTaskTag));
}
/**
*
*/
@ApiOperation("删除任务标签")
@Log(title = "任务标签删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskTagService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskTag> queryWrapper,CtTaskTag ctTaskTag){
//id
if(Validator.isNotEmpty(ctTaskTag.getId())){
queryWrapper.eq(CtTaskTag::getId,ctTaskTag.getId());
}
//任务模板id
if(Validator.isNotEmpty(ctTaskTag.getTaskId())){
queryWrapper.eq(CtTaskTag::getTaskId,ctTaskTag.getTaskId());
}
//标签名称
if(Validator.isNotEmpty(ctTaskTag.getTagName())){
queryWrapper.eq(CtTaskTag::getTagName,ctTaskTag.getTagName());
}
//标签说明
if(Validator.isNotEmpty(ctTaskTag.getTagDesc())){
queryWrapper.eq(CtTaskTag::getTagDesc,ctTaskTag.getTagDesc());
}
//是否需要拍照
if(Validator.isNotEmpty(ctTaskTag.getIsPhoto())){
queryWrapper.eq(CtTaskTag::getIsPhoto,ctTaskTag.getIsPhoto());
}
//拍照数量要求
if(Validator.isNotEmpty(ctTaskTag.getPhotoNum())){
queryWrapper.eq(CtTaskTag::getPhotoNum,ctTaskTag.getPhotoNum());
}
//照片存放目录
if(Validator.isNotEmpty(ctTaskTag.getSaveDir())){
queryWrapper.eq(CtTaskTag::getSaveDir,ctTaskTag.getSaveDir());
}
//附件id
if(Validator.isNotEmpty(ctTaskTag.getFileId())){
queryWrapper.eq(CtTaskTag::getFileId,ctTaskTag.getFileId());
}
//备注
if(Validator.isNotEmpty(ctTaskTag.getRemarks())){
queryWrapper.eq(CtTaskTag::getRemarks,ctTaskTag.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskTag.getDelFlag())){
queryWrapper.eq(CtTaskTag::getDelFlag,ctTaskTag.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskTag.getCreateDept())){
queryWrapper.eq(CtTaskTag::getCreateDept,ctTaskTag.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskTag.getCreateBy())){
queryWrapper.eq(CtTaskTag::getCreateBy,ctTaskTag.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskTag.getCreateTime())){
queryWrapper.eq(CtTaskTag::getCreateTime,ctTaskTag.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskTag.getUpdateBy())){
queryWrapper.eq(CtTaskTag::getUpdateBy,ctTaskTag.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskTag.getUpdateTime())){
queryWrapper.eq(CtTaskTag::getUpdateTime,ctTaskTag.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskTag.getTenantId())){
queryWrapper.eq(CtTaskTag::getTenantId,ctTaskTag.getTenantId());
}
}
}

@ -0,0 +1,194 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskTemplate;
import com.bs.ct.service.ICtTaskTemplateService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务模板")
@RestController
@RequestMapping("/task/template")
public class CtTaskTemplateController extends BaseController {
@Resource
private ICtTaskTemplateService ctTaskTemplateService;
/**
*
*/
@ApiOperation("分页查询任务模板列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskTemplate ctTaskTemplate) {
startPage();
LambdaQueryWrapper<CtTaskTemplate> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplate);
List<CtTaskTemplate> list = ctTaskTemplateService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务模板列表")
@GetMapping("/list")
public AjaxResult list(CtTaskTemplate ctTaskTemplate) {
LambdaQueryWrapper<CtTaskTemplate> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplate);
List<CtTaskTemplate> list = ctTaskTemplateService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务模板列表")
@Log(title = "任务模板导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskTemplate ctTaskTemplate) {
LambdaQueryWrapper<CtTaskTemplate> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplate);
List<CtTaskTemplate> list = ctTaskTemplateService.list(queryWrapper);
ExcelUtil<CtTaskTemplate> util = new ExcelUtil<CtTaskTemplate>(CtTaskTemplate. class);
util.exportExcel(response, list, "任务模板数据");
}
/**
*
*/
@ApiOperation("获取任务模板详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskTemplateService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务模板")
@Log(title = "任务模板新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskTemplate ctTaskTemplate) {
return toAjax(ctTaskTemplateService.save(ctTaskTemplate));
}
/**
*
*/
@ApiOperation("修改任务模板")
@Log(title = "任务模板修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskTemplate ctTaskTemplate) {
return toAjax(ctTaskTemplateService.updateById(ctTaskTemplate));
}
/**
*
*/
@ApiOperation("删除任务模板")
@Log(title = "任务模板删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskTemplateService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskTemplate> queryWrapper,CtTaskTemplate ctTaskTemplate){
//id
if(Validator.isNotEmpty(ctTaskTemplate.getId())){
queryWrapper.eq(CtTaskTemplate::getId,ctTaskTemplate.getId());
}
//任务类型
if(Validator.isNotEmpty(ctTaskTemplate.getTaskType())){
queryWrapper.eq(CtTaskTemplate::getTaskType,ctTaskTemplate.getTaskType());
}
//模板名称
if(Validator.isNotEmpty(ctTaskTemplate.getTemplateName())){
queryWrapper.eq(CtTaskTemplate::getTemplateName,ctTaskTemplate.getTemplateName());
}
//任务标题
if(Validator.isNotEmpty(ctTaskTemplate.getTaskTitle())){
queryWrapper.eq(CtTaskTemplate::getTaskTitle,ctTaskTemplate.getTaskTitle());
}
//任务要求
if(Validator.isNotEmpty(ctTaskTemplate.getTaskContent())){
queryWrapper.eq(CtTaskTemplate::getTaskContent,ctTaskTemplate.getTaskContent());
}
//备注
if(Validator.isNotEmpty(ctTaskTemplate.getRemarks())){
queryWrapper.eq(CtTaskTemplate::getRemarks,ctTaskTemplate.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskTemplate.getDelFlag())){
queryWrapper.eq(CtTaskTemplate::getDelFlag,ctTaskTemplate.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskTemplate.getCreateDept())){
queryWrapper.eq(CtTaskTemplate::getCreateDept,ctTaskTemplate.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskTemplate.getCreateBy())){
queryWrapper.eq(CtTaskTemplate::getCreateBy,ctTaskTemplate.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskTemplate.getCreateTime())){
queryWrapper.eq(CtTaskTemplate::getCreateTime,ctTaskTemplate.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskTemplate.getUpdateBy())){
queryWrapper.eq(CtTaskTemplate::getUpdateBy,ctTaskTemplate.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskTemplate.getUpdateTime())){
queryWrapper.eq(CtTaskTemplate::getUpdateTime,ctTaskTemplate.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskTemplate.getTenantId())){
queryWrapper.eq(CtTaskTemplate::getTenantId,ctTaskTemplate.getTenantId());
}
}
}

@ -0,0 +1,209 @@
package com.bs.ct.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.lang.Validator;
import com.bs.ct.domain.CtTaskTemplateTag;
import com.bs.ct.service.ICtTaskTemplateTagService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-02-22
*/
@Api(tags = "任务模板标签")
@RestController
@RequestMapping("/task/template/tag")
public class CtTaskTemplateTagController extends BaseController {
@Resource
private ICtTaskTemplateTagService ctTaskTemplateTagService;
/**
*
*/
@ApiOperation("分页查询任务模板标签列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CtTaskTemplateTag ctTaskTemplateTag) {
startPage();
LambdaQueryWrapper<CtTaskTemplateTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplateTag);
List<CtTaskTemplateTag> list = ctTaskTemplateTagService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询任务模板标签列表")
@GetMapping("/list")
public AjaxResult list(CtTaskTemplateTag ctTaskTemplateTag) {
LambdaQueryWrapper<CtTaskTemplateTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplateTag);
List<CtTaskTemplateTag> list = ctTaskTemplateTagService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出任务模板标签列表")
@Log(title = "任务模板标签导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtTaskTemplateTag ctTaskTemplateTag) {
LambdaQueryWrapper<CtTaskTemplateTag> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskTemplateTag);
List<CtTaskTemplateTag> list = ctTaskTemplateTagService.list(queryWrapper);
ExcelUtil<CtTaskTemplateTag> util = new ExcelUtil<CtTaskTemplateTag>(CtTaskTemplateTag. class);
util.exportExcel(response, list, "任务模板标签数据");
}
/**
*
*/
@ApiOperation("获取任务模板标签详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ctTaskTemplateTagService.getById(id));
}
/**
*
*/
@ApiOperation("新增任务模板标签")
@Log(title = "任务模板标签新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtTaskTemplateTag ctTaskTemplateTag) {
return toAjax(ctTaskTemplateTagService.save(ctTaskTemplateTag));
}
/**
*
*/
@ApiOperation("修改任务模板标签")
@Log(title = "任务模板标签修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtTaskTemplateTag ctTaskTemplateTag) {
return toAjax(ctTaskTemplateTagService.updateById(ctTaskTemplateTag));
}
/**
*
*/
@ApiOperation("删除任务模板标签")
@Log(title = "任务模板标签删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(ctTaskTemplateTagService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CtTaskTemplateTag> queryWrapper,CtTaskTemplateTag ctTaskTemplateTag){
//id
if(Validator.isNotEmpty(ctTaskTemplateTag.getId())){
queryWrapper.eq(CtTaskTemplateTag::getId,ctTaskTemplateTag.getId());
}
//任务模板id
if(Validator.isNotEmpty(ctTaskTemplateTag.getTemplateId())){
queryWrapper.eq(CtTaskTemplateTag::getTemplateId,ctTaskTemplateTag.getTemplateId());
}
//标签名称
if(Validator.isNotEmpty(ctTaskTemplateTag.getTagName())){
queryWrapper.eq(CtTaskTemplateTag::getTagName,ctTaskTemplateTag.getTagName());
}
//标签说明
if(Validator.isNotEmpty(ctTaskTemplateTag.getTagDesc())){
queryWrapper.eq(CtTaskTemplateTag::getTagDesc,ctTaskTemplateTag.getTagDesc());
}
//是否需要拍照
if(Validator.isNotEmpty(ctTaskTemplateTag.getIsPhoto())){
queryWrapper.eq(CtTaskTemplateTag::getIsPhoto,ctTaskTemplateTag.getIsPhoto());
}
//拍照数量要求
if(Validator.isNotEmpty(ctTaskTemplateTag.getPhotoNum())){
queryWrapper.eq(CtTaskTemplateTag::getPhotoNum,ctTaskTemplateTag.getPhotoNum());
}
//照片存放目录
if(Validator.isNotEmpty(ctTaskTemplateTag.getSaveDir())){
queryWrapper.eq(CtTaskTemplateTag::getSaveDir,ctTaskTemplateTag.getSaveDir());
}
//附件id
if(Validator.isNotEmpty(ctTaskTemplateTag.getFileId())){
queryWrapper.eq(CtTaskTemplateTag::getFileId,ctTaskTemplateTag.getFileId());
}
//备注
if(Validator.isNotEmpty(ctTaskTemplateTag.getRemarks())){
queryWrapper.eq(CtTaskTemplateTag::getRemarks,ctTaskTemplateTag.getRemarks());
}
//删除标志0代表存在 2代表删除
if(Validator.isNotEmpty(ctTaskTemplateTag.getDelFlag())){
queryWrapper.eq(CtTaskTemplateTag::getDelFlag,ctTaskTemplateTag.getDelFlag());
}
//创建部门
if(Validator.isNotEmpty(ctTaskTemplateTag.getCreateDept())){
queryWrapper.eq(CtTaskTemplateTag::getCreateDept,ctTaskTemplateTag.getCreateDept());
}
//创建人
if(Validator.isNotEmpty(ctTaskTemplateTag.getCreateBy())){
queryWrapper.eq(CtTaskTemplateTag::getCreateBy,ctTaskTemplateTag.getCreateBy());
}
//创建时间
if(Validator.isNotEmpty(ctTaskTemplateTag.getCreateTime())){
queryWrapper.eq(CtTaskTemplateTag::getCreateTime,ctTaskTemplateTag.getCreateTime());
}
//修改人
if(Validator.isNotEmpty(ctTaskTemplateTag.getUpdateBy())){
queryWrapper.eq(CtTaskTemplateTag::getUpdateBy,ctTaskTemplateTag.getUpdateBy());
}
//修改时间
if(Validator.isNotEmpty(ctTaskTemplateTag.getUpdateTime())){
queryWrapper.eq(CtTaskTemplateTag::getUpdateTime,ctTaskTemplateTag.getUpdateTime());
}
//租户ID
if(Validator.isNotEmpty(ctTaskTemplateTag.getTenantId())){
queryWrapper.eq(CtTaskTemplateTag::getTenantId,ctTaskTemplateTag.getTenantId());
}
}
}

@ -0,0 +1,59 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_gallery_cata
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_gallery_cata")
@Data
public class CtGalleryCata extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 目录名称 */
@Excel(name = "目录名称")
@ApiModelProperty(value = "目录名称")
private String cataName;
/** 父级id */
@Excel(name = "父级id")
@ApiModelProperty(value = "父级id")
private Long parentId;
/** 类型 */
@Excel(name = "类型")
@ApiModelProperty(value = "类型")
private String type;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,75 @@
package com.bs.ct.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_gallery_cata_share
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_gallery_cata_share")
@Data
public class CtGalleryCataShare extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 共享类型目录共享、图片共享 */
@Excel(name = "共享类型目录共享、图片共享")
@ApiModelProperty(value = "共享类型目录共享、图片共享")
private String type;
/** 目录id */
@Excel(name = "目录id")
@ApiModelProperty(value = "目录id")
private Long cataId;
/** 共享用户 */
@Excel(name = "共享用户")
@ApiModelProperty(value = "共享用户")
private Long userId;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "开始时间")
private Date beginDate;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "结束时间")
private Date endDate;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,106 @@
package com.bs.ct.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_gallery_images
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_gallery_images")
@Data
public class CtGalleryImages extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 目录id */
@Excel(name = "目录id")
@ApiModelProperty(value = "目录id")
private Long cataId;
/** 图片名称 */
@Excel(name = "图片名称")
@ApiModelProperty(value = "图片名称")
private String imageName;
/** 图片标题 */
@Excel(name = "图片标题")
@ApiModelProperty(value = "图片标题")
private String imageTitle;
/** 图片路径 */
@Excel(name = "图片路径")
@ApiModelProperty(value = "图片路径")
private String imagePath;
/** 图片大小 */
@Excel(name = "图片大小")
@ApiModelProperty(value = "图片大小")
private BigDecimal imageSize;
/** 图片拍摄时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "图片拍摄时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "图片拍摄时间")
private Date photoTime;
/** 图片上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "图片上传时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "图片上传时间")
private Date uploadTime;
/** 是否公开 */
@Excel(name = "是否公开")
@ApiModelProperty(value = "是否公开")
private String isOpen;
/** 图片关键字 */
@Excel(name = "图片关键字")
@ApiModelProperty(value = "图片关键字")
private String keyWords;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,53 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_gallery_images_tag
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_gallery_images_tag")
@Data
public class CtGalleryImagesTag extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 图片id */
@Excel(name = "图片id")
@ApiModelProperty(value = "图片id")
private Long imageId;
/** 标签名称 */
@Excel(name = "标签名称")
@ApiModelProperty(value = "标签名称")
private String tagName;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,77 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_tag
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_tag")
@Data
public class CtTag extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 标签名称 */
@Excel(name = "标签名称")
@ApiModelProperty(value = "标签名称")
private String tagName;
/** 标签说明 */
@Excel(name = "标签说明")
@ApiModelProperty(value = "标签说明")
private String tagDesc;
/** 是否需要拍照 */
@Excel(name = "是否需要拍照")
@ApiModelProperty(value = "是否需要拍照")
private String isPhoto;
/** 拍照数量要求 */
@Excel(name = "拍照数量要求")
@ApiModelProperty(value = "拍照数量要求")
private Long photoNum;
/** 照片存放目录 */
@Excel(name = "照片存放目录")
@ApiModelProperty(value = "照片存放目录")
private Long saveDir;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,71 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_branch
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_branch")
@Data
public class CtTaskBranch extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务id */
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
private Long taskId;
/** 类型人员、机构 */
@Excel(name = "类型人员、机构")
@ApiModelProperty(value = "类型人员、机构")
private String type;
/** 机构代码 */
@Excel(name = "机构代码")
@ApiModelProperty(value = "机构代码")
private String branchCode;
/** 机构名称 */
@Excel(name = "机构名称")
@ApiModelProperty(value = "机构名称")
private String branchName;
/** 任务状态 */
@Excel(name = "任务状态")
@ApiModelProperty(value = "任务状态")
private String taskStatus;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,141 @@
package com.bs.ct.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_feedback
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_feedback")
@Data
public class CtTaskFeedback extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务id */
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
private Long taskId;
/** 机构任务id */
@Excel(name = "机构任务id")
@ApiModelProperty(value = "机构任务id")
private Long taskBranchId;
/** 机构代码 */
@Excel(name = "机构代码")
@ApiModelProperty(value = "机构代码")
private String branchCode;
/** 任务反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "任务反馈时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "任务反馈时间")
private Date feedbackTime;
/** 任务完成情况 */
@Excel(name = "任务完成情况")
@ApiModelProperty(value = "任务完成情况")
private String taskDesc;
/** 操作人员工号 */
@Excel(name = "操作人员工号")
@ApiModelProperty(value = "操作人员工号")
private String userId;
/** 操作人员姓名 */
@Excel(name = "操作人员姓名")
@ApiModelProperty(value = "操作人员姓名")
private String userName;
/** 操作人员部门 */
@Excel(name = "操作人员部门")
@ApiModelProperty(value = "操作人员部门")
private String userDept;
/** 是否已拍照留存 */
@Excel(name = "是否已拍照留存")
@ApiModelProperty(value = "是否已拍照留存")
private String isPhoto;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 审核人员id */
@Excel(name = "审核人员id")
@ApiModelProperty(value = "审核人员id")
private String checkUserId;
/** 审核人员姓名 */
@Excel(name = "审核人员姓名")
@ApiModelProperty(value = "审核人员姓名")
private String checkUserName;
/** 审核人员部门 */
@Excel(name = "审核人员部门")
@ApiModelProperty(value = "审核人员部门")
private String checkUserDept;
/** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "审核时间")
private Date checkDate;
/** 审核状态 */
@Excel(name = "审核状态")
@ApiModelProperty(value = "审核状态")
private String status;
/** 审核信息 */
@Excel(name = "审核信息")
@ApiModelProperty(value = "审核信息")
private String checkInfo;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,53 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_images
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_images")
@Data
public class CtTaskImages extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务id */
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
private Long taskId;
/** 图片id */
@Excel(name = "图片id")
@ApiModelProperty(value = "图片id")
private Long imageId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,124 @@
package com.bs.ct.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_info
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_info")
@Data
public class CtTaskInfo extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务类型 */
@Excel(name = "任务类型")
@ApiModelProperty(value = "任务类型")
private String taskType;
/** 任务标题 */
@Excel(name = "任务标题")
@ApiModelProperty(value = "任务标题")
private String taskTitle;
/** 任务编号 */
@Excel(name = "任务编号")
@ApiModelProperty(value = "任务编号")
private String taskCode;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "开始时间")
private Date startDate;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "结束时间")
private Date endDate;
/** 任务要求 */
@Excel(name = "任务要求")
@ApiModelProperty(value = "任务要求")
private String taskContent;
/** 完成状态 */
@Excel(name = "完成状态")
@ApiModelProperty(value = "完成状态")
private String status;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 任务发起人 */
@Excel(name = "任务发起人")
@ApiModelProperty(value = "任务发起人")
private String taskInitiator;
/** 任务发起单位机构代码 */
@Excel(name = "任务发起单位机构代码")
@ApiModelProperty(value = "任务发起单位机构代码")
private String branchCode;
/** 任务发起单位 */
@Excel(name = "任务发起单位")
@ApiModelProperty(value = "任务发起单位")
private String branchName;
/** 任务发起部门 */
@Excel(name = "任务发起部门")
@ApiModelProperty(value = "任务发起部门")
private Long deptId;
/** 任务发布日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "任务发布日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "任务发布日期")
private Date taskDate;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,83 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_tag
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_tag")
@Data
public class CtTaskTag extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务模板id */
@Excel(name = "任务模板id")
@ApiModelProperty(value = "任务模板id")
private Long taskId;
/** 标签名称 */
@Excel(name = "标签名称")
@ApiModelProperty(value = "标签名称")
private String tagName;
/** 标签说明 */
@Excel(name = "标签说明")
@ApiModelProperty(value = "标签说明")
private String tagDesc;
/** 是否需要拍照 */
@Excel(name = "是否需要拍照")
@ApiModelProperty(value = "是否需要拍照")
private String isPhoto;
/** 拍照数量要求 */
@Excel(name = "拍照数量要求")
@ApiModelProperty(value = "拍照数量要求")
private Long photoNum;
/** 照片存放目录 */
@Excel(name = "照片存放目录")
@ApiModelProperty(value = "照片存放目录")
private Long saveDir;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,65 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_template
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_template")
@Data
public class CtTaskTemplate extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务类型 */
@Excel(name = "任务类型")
@ApiModelProperty(value = "任务类型")
private String taskType;
/** 模板名称 */
@Excel(name = "模板名称")
@ApiModelProperty(value = "模板名称")
private String templateName;
/** 任务标题 */
@Excel(name = "任务标题")
@ApiModelProperty(value = "任务标题")
private String taskTitle;
/** 任务要求 */
@Excel(name = "任务要求")
@ApiModelProperty(value = "任务要求")
private String taskContent;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,83 @@
package com.bs.ct.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* ct_task_template_tag
*
* @author bs
* @date 2025-02-22
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ct_task_template_tag")
@Data
public class CtTaskTemplateTag extends BaseEntity{
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "id")
private Long id;
/** 任务模板id */
@Excel(name = "任务模板id")
@ApiModelProperty(value = "任务模板id")
private Long templateId;
/** 标签名称 */
@Excel(name = "标签名称")
@ApiModelProperty(value = "标签名称")
private String tagName;
/** 标签说明 */
@Excel(name = "标签说明")
@ApiModelProperty(value = "标签说明")
private String tagDesc;
/** 是否需要拍照 */
@Excel(name = "是否需要拍照")
@ApiModelProperty(value = "是否需要拍照")
private String isPhoto;
/** 拍照数量要求 */
@Excel(name = "拍照数量要求")
@ApiModelProperty(value = "拍照数量要求")
private Long photoNum;
/** 照片存放目录 */
@Excel(name = "照片存放目录")
@ApiModelProperty(value = "照片存放目录")
private Long saveDir;
/** 附件id */
@Excel(name = "附件id")
@ApiModelProperty(value = "附件id")
private Long fileId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtGalleryCata;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtGalleryCataMapper extends BaseMapperX<CtGalleryCata> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtGalleryCataShare;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtGalleryCataShareMapper extends BaseMapperX<CtGalleryCataShare> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtGalleryImages;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtGalleryImagesMapper extends BaseMapperX<CtGalleryImages> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtGalleryImagesTag;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtGalleryImagesTagMapper extends BaseMapperX<CtGalleryImagesTag> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTag;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTagMapper extends BaseMapperX<CtTag> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskBranch;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskBranchMapper extends BaseMapperX<CtTaskBranch> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskFeedback;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskFeedbackMapper extends BaseMapperX<CtTaskFeedback> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskImages;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskImagesMapper extends BaseMapperX<CtTaskImages> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskInfo;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskInfoMapper extends BaseMapperX<CtTaskInfo> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskTag;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskTagMapper extends BaseMapperX<CtTaskTag> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskTemplate;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskTemplateMapper extends BaseMapperX<CtTaskTemplate> {
}

@ -0,0 +1,14 @@
package com.bs.ct.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.ct.domain.CtTaskTemplateTag;
/**
* Mapper
*
* @author bs
* @date 2025-02-22
*/
public interface CtTaskTemplateTagMapper extends BaseMapperX<CtTaskTemplateTag> {
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtGalleryCata;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtGalleryCataService extends MPJBaseService<CtGalleryCata>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtGalleryCataShare;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtGalleryCataShareService extends MPJBaseService<CtGalleryCataShare>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtGalleryImages;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtGalleryImagesService extends MPJBaseService<CtGalleryImages>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtGalleryImagesTag;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtGalleryImagesTagService extends MPJBaseService<CtGalleryImagesTag>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTag;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTagService extends MPJBaseService<CtTag>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskBranch;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskBranchService extends MPJBaseService<CtTaskBranch>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskFeedback;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskFeedbackService extends MPJBaseService<CtTaskFeedback>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskImages;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskImagesService extends MPJBaseService<CtTaskImages>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskInfo;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskInfoService extends MPJBaseService<CtTaskInfo>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskTag;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskTagService extends MPJBaseService<CtTaskTag>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskTemplate;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskTemplateService extends MPJBaseService<CtTaskTemplate>{
}

@ -0,0 +1,14 @@
package com.bs.ct.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.ct.domain.CtTaskTemplateTag;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
public interface ICtTaskTemplateTagService extends MPJBaseService<CtTaskTemplateTag>{
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtGalleryCataMapper;
import com.bs.ct.domain.CtGalleryCata;
import com.bs.ct.service.ICtGalleryCataService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtGalleryCataServiceImpl extends MPJBaseServiceImpl<CtGalleryCataMapper, CtGalleryCata> implements ICtGalleryCataService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtGalleryCataShareMapper;
import com.bs.ct.domain.CtGalleryCataShare;
import com.bs.ct.service.ICtGalleryCataShareService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtGalleryCataShareServiceImpl extends MPJBaseServiceImpl<CtGalleryCataShareMapper, CtGalleryCataShare> implements ICtGalleryCataShareService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtGalleryImagesMapper;
import com.bs.ct.domain.CtGalleryImages;
import com.bs.ct.service.ICtGalleryImagesService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtGalleryImagesServiceImpl extends MPJBaseServiceImpl<CtGalleryImagesMapper, CtGalleryImages> implements ICtGalleryImagesService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtGalleryImagesTagMapper;
import com.bs.ct.domain.CtGalleryImagesTag;
import com.bs.ct.service.ICtGalleryImagesTagService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtGalleryImagesTagServiceImpl extends MPJBaseServiceImpl<CtGalleryImagesTagMapper, CtGalleryImagesTag> implements ICtGalleryImagesTagService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTagMapper;
import com.bs.ct.domain.CtTag;
import com.bs.ct.service.ICtTagService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTagServiceImpl extends MPJBaseServiceImpl<CtTagMapper, CtTag> implements ICtTagService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskBranchMapper;
import com.bs.ct.domain.CtTaskBranch;
import com.bs.ct.service.ICtTaskBranchService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskBranchServiceImpl extends MPJBaseServiceImpl<CtTaskBranchMapper, CtTaskBranch> implements ICtTaskBranchService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskFeedbackMapper;
import com.bs.ct.domain.CtTaskFeedback;
import com.bs.ct.service.ICtTaskFeedbackService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskFeedbackServiceImpl extends MPJBaseServiceImpl<CtTaskFeedbackMapper, CtTaskFeedback> implements ICtTaskFeedbackService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskImagesMapper;
import com.bs.ct.domain.CtTaskImages;
import com.bs.ct.service.ICtTaskImagesService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskImagesServiceImpl extends MPJBaseServiceImpl<CtTaskImagesMapper, CtTaskImages> implements ICtTaskImagesService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskInfoMapper;
import com.bs.ct.domain.CtTaskInfo;
import com.bs.ct.service.ICtTaskInfoService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskInfoServiceImpl extends MPJBaseServiceImpl<CtTaskInfoMapper, CtTaskInfo> implements ICtTaskInfoService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskTagMapper;
import com.bs.ct.domain.CtTaskTag;
import com.bs.ct.service.ICtTaskTagService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskTagServiceImpl extends MPJBaseServiceImpl<CtTaskTagMapper, CtTaskTag> implements ICtTaskTagService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskTemplateMapper;
import com.bs.ct.domain.CtTaskTemplate;
import com.bs.ct.service.ICtTaskTemplateService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskTemplateServiceImpl extends MPJBaseServiceImpl<CtTaskTemplateMapper, CtTaskTemplate> implements ICtTaskTemplateService {
}

@ -0,0 +1,19 @@
package com.bs.ct.service.impl;
import com.bs.ct.mapper.CtTaskTemplateTagMapper;
import com.bs.ct.domain.CtTaskTemplateTag;
import com.bs.ct.service.ICtTaskTemplateTagService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-02-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CtTaskTemplateTagServiceImpl extends MPJBaseServiceImpl<CtTaskTemplateTagMapper, CtTaskTemplateTag> implements ICtTaskTemplateTagService {
}

@ -0,0 +1,94 @@
package com.bs.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.bs.common.config.BsConfig;
import com.bs.common.constant.CacheConstants;
import com.bs.common.constant.Constants;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.redis.RedisCache;
import com.bs.common.utils.sign.Base64;
import com.bs.common.utils.uuid.IdUtils;
import com.bs.system.service.ISysConfigService;
/**
*
*
* @author bs
*/
@RestController
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = BsConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

@ -0,0 +1,163 @@
package com.bs.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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 com.bs.common.config.BsConfig;
import com.bs.common.constant.Constants;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.utils.StringUtils;
import com.bs.common.utils.file.FileUploadUtils;
import com.bs.common.utils.file.FileUtils;
import com.bs.framework.config.ServerConfig;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/**
*
*
* @param fileName
* @param delete
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = BsConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
/**
*
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
{
// 上传文件路径
String filePath = BsConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = BsConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
*
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = BsConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

@ -0,0 +1,120 @@
package com.bs.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.constant.CacheConstants;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.utils.StringUtils;
import com.bs.system.domain.SysCache;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(cacheKeys);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

@ -0,0 +1,27 @@
package com.bs.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.framework.web.domain.Server;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Server server = new Server();
server.copyTo();
return AjaxResult.success(server);
}
}

@ -0,0 +1,82 @@
package com.bs.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.framework.web.service.SysPasswordService;
import com.bs.system.domain.SysLogininfor;
import com.bs.system.service.ISysLogininforService;
/**
* 访
*
* @author bs
*/
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController
{
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)
{
startPage();
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysLogininfor logininfor)
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
util.exportExcel(response, list, "登录日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public AjaxResult remove(@PathVariable Long[] infoIds)
{
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean()
{
logininforService.cleanLogininfor();
return success();
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public AjaxResult unlock(@PathVariable("userName") String userName)
{
passwordService.clearLoginRecordCache(userName);
return success();
}
}

@ -0,0 +1,69 @@
package com.bs.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.domain.SysOperLog;
import com.bs.system.service.ISysOperLogService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController
{
@Autowired
private ISysOperLogService operLogService;
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping("/list")
public TableDataInfo list(SysOperLog operLog)
{
startPage();
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list);
}
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysOperLog operLog)
{
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)
{
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/clean")
public AjaxResult clean()
{
operLogService.cleanOperLog();
return success();
}
}

@ -0,0 +1,83 @@
package com.bs.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.constant.CacheConstants;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.model.LoginUser;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.core.redis.RedisCache;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.StringUtils;
import com.bs.system.domain.SysUserOnline;
import com.bs.system.service.ISysUserOnlineService;
/**
* 线
*
* @author bs
*/
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController
{
@Autowired
private ISysUserOnlineService userOnlineService;
@Autowired
private RedisCache redisCache;
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
@GetMapping("/list")
public TableDataInfo list(String ipaddr, String userName)
{
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys)
{
LoginUser user = redisCache.getCacheObject(key);
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
{
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
else if (StringUtils.isNotEmpty(ipaddr))
{
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
{
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
else
{
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
}
}
Collections.reverse(userOnlineList);
userOnlineList.removeAll(Collections.singleton(null));
return getDataTable(userOnlineList);
}
/**
* 退
*/
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}
}

@ -0,0 +1,133 @@
package com.bs.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.domain.SysConfig;
import com.bs.system.service.ISysConfigService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController
{
@Autowired
private ISysConfigService configService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:list')")
@GetMapping("/list")
public TableDataInfo list(SysConfig config)
{
startPage();
List<SysConfig> list = configService.selectConfigList(config);
return getDataTable(list);
}
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:config:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysConfig config)
{
List<SysConfig> list = configService.selectConfigList(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId)
{
return success(configService.selectConfigById(configId));
}
/**
*
*/
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey)
{
return success(configService.selectConfigByKey(configKey));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:edit')")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
configService.deleteConfigByIds(configIds);
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.resetConfigCache();
return success();
}
}

@ -0,0 +1,132 @@
package com.bs.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.constant.UserConstants;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysDept;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.StringUtils;
import com.bs.system.service.ISysDeptService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController
{
@Autowired
private ISysDeptService deptService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list")
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list/exclude/{deptId}")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
return success(depts);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:query')")
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
{
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:add')")
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkDeptNameUnique(dept))
{
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
Long deptId = dept.getDeptId();
deptService.checkDeptDataScope(deptId);
if (!deptService.checkDeptNameUnique(dept))
{
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(deptId))
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
{
return error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable Long deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
return warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return warn("部门存在用户,不允许删除");
}
deptService.checkDeptDataScope(deptId);
return toAjax(deptService.deleteDeptById(deptId));
}
}

@ -0,0 +1,121 @@
package com.bs.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysDictData;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.StringUtils;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.service.ISysDictDataService;
import com.bs.system.service.ISysDictTypeService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
@Autowired
private ISysDictDataService dictDataService;
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictData dictData)
{
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictData dictData)
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return success(dictDataService.selectDictDataById(dictCode));
}
/**
*
*/
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

@ -0,0 +1,131 @@
package com.bs.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysDictType;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.service.ISysDictTypeService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/dict/type")
public class SysDictTypeController extends BaseController
{
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictType dictType)
{
startPage();
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictType dictType)
{
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
}
/**
*
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

@ -0,0 +1,29 @@
package com.bs.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.config.BsConfig;
import com.bs.common.utils.StringUtils;
/**
*
*
* @author bs
*/
@RestController
public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private BsConfig bsConfig;
/**
* 访
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", bsConfig.getName(), bsConfig.getVersion());
}
}

@ -0,0 +1,86 @@
package com.bs.web.controller.system;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.constant.Constants;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysMenu;
import com.bs.common.core.domain.entity.SysUser;
import com.bs.common.core.domain.model.LoginBody;
import com.bs.common.utils.SecurityUtils;
import com.bs.framework.web.service.SysLoginService;
import com.bs.framework.web.service.SysPermissionService;
import com.bs.system.service.ISysMenuService;
/**
*
*
* @author bs
*/
@RestController
public class SysLoginController
{
@Autowired
private SysLoginService loginService;
@Autowired
private ISysMenuService menuService;
@Autowired
private SysPermissionService permissionService;
/**
*
*
* @param loginBody
* @return
*/
@PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
*
*
* @return
*/
@GetMapping("getInfo")
public AjaxResult getInfo()
{
SysUser user = SecurityUtils.getLoginUser().getUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
*
*
* @return
*/
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
}

@ -0,0 +1,142 @@
package com.bs.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.constant.UserConstants;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysMenu;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.StringUtils;
import com.bs.system.service.ISysMenuService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController
{
@Autowired
private ISysMenuService menuService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:list')")
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menus);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:query')")
@GetMapping(value = "/{menuId}")
public AjaxResult getInfo(@PathVariable Long menuId)
{
return success(menuService.selectMenuById(menuId));
}
/**
*
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menuService.buildMenuTreeSelect(menus));
}
/**
*
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
return ajax;
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:add')")
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
else if (menu.getMenuId().equals(menu.getParentId()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{menuId}")
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
if (menuService.hasChildByMenuId(menuId))
{
return warn("存在子菜单,不允许删除");
}
if (menuService.checkMenuExistRole(menuId))
{
return warn("菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}
}

@ -0,0 +1,91 @@
package com.bs.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.system.domain.SysNotice;
import com.bs.system.service.ISysNoticeService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/notice")
public class SysNoticeController extends BaseController
{
@Autowired
private ISysNoticeService noticeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:list')")
@GetMapping("/list")
public TableDataInfo list(SysNotice notice)
{
startPage();
List<SysNotice> list = noticeService.selectNoticeList(notice);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return success(noticeService.selectNoticeById(noticeId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
}

@ -0,0 +1,129 @@
package com.bs.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.domain.SysPost;
import com.bs.system.service.ISysPostService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/post")
public class SysPostController extends BaseController
{
@Autowired
private ISysPostService postService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:list')")
@GetMapping("/list")
public TableDataInfo list(SysPost post)
{
startPage();
List<SysPost> list = postService.selectPostList(post);
return getDataTable(list);
}
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:post:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysPost post)
{
List<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
util.exportExcel(response, list, "岗位数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:query')")
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable Long postId)
{
return success(postService.selectPostById(postId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:add')")
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:edit')")
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:post:remove')")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public AjaxResult remove(@PathVariable Long[] postIds)
{
return toAjax(postService.deletePostByIds(postIds));
}
/**
*
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysPost> posts = postService.selectPostAll();
return success(posts);
}
}

@ -0,0 +1,141 @@
package com.bs.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.bs.common.annotation.Log;
import com.bs.common.config.BsConfig;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysUser;
import com.bs.common.core.domain.model.LoginUser;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.SecurityUtils;
import com.bs.common.utils.StringUtils;
import com.bs.common.utils.file.FileUploadUtils;
import com.bs.common.utils.file.MimeTypeUtils;
import com.bs.framework.web.service.TokenService;
import com.bs.system.service.ISysUserService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private TokenService tokenService;
/**
*
*/
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
/**
*
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
LoginUser loginUser = getLoginUser();
SysUser sysUser = loginUser.getUser();
user.setUserName(sysUser.getUserName());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUserId(sysUser.getUserId());
user.setPassword(null);
user.setAvatar(null);
user.setDeptId(null);
if (userService.updateUserProfile(user) > 0)
{
// 更新缓存用户信息
sysUser.setNickName(user.getNickName());
sysUser.setPhonenumber(user.getPhonenumber());
sysUser.setEmail(user.getEmail());
sysUser.setSex(user.getSex());
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改个人信息异常,请联系管理员");
}
/**
*
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword)
{
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return error("修改密码失败,旧密码错误");
}
if (SecurityUtils.matchesPassword(newPassword, password))
{
return error("新密码不能与旧密码相同");
}
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改密码异常,请联系管理员");
}
/**
*
*/
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
{
if (!file.isEmpty())
{
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(BsConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
{
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);
// 更新缓存用户头像
loginUser.getUser().setAvatar(avatar);
tokenService.setLoginUser(loginUser);
return ajax;
}
}
return error("上传图片异常,请联系管理员");
}
}

@ -0,0 +1,38 @@
package com.bs.web.controller.system;
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.RestController;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.model.RegisterBody;
import com.bs.common.utils.StringUtils;
import com.bs.framework.web.service.SysRegisterService;
import com.bs.system.service.ISysConfigService;
/**
*
*
* @author bs
*/
@RestController
public class SysRegisterController extends BaseController
{
@Autowired
private SysRegisterService registerService;
@Autowired
private ISysConfigService configService;
@PostMapping("/register")
public AjaxResult register(@RequestBody RegisterBody user)
{
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
{
return error("当前系统没有开启注册功能!");
}
String msg = registerService.register(user);
return StringUtils.isEmpty(msg) ? success() : error(msg);
}
}

@ -0,0 +1,262 @@
package com.bs.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysDept;
import com.bs.common.core.domain.entity.SysRole;
import com.bs.common.core.domain.entity.SysUser;
import com.bs.common.core.domain.model.LoginUser;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.StringUtils;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.framework.web.service.SysPermissionService;
import com.bs.framework.web.service.TokenService;
import com.bs.system.domain.SysUserRole;
import com.bs.system.service.ISysDeptService;
import com.bs.system.service.ISysRoleService;
import com.bs.system.service.ISysUserService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController
{
@Autowired
private ISysRoleService roleService;
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private ISysUserService userService;
@Autowired
private ISysDeptService deptService;
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
{
startPage();
List<SysRole> list = roleService.selectRoleList(role);
return getDataTable(list);
}
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:role:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysRole role)
{
List<SysRole> list = roleService.selectRoleList(role);
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
util.exportExcel(response, list, "角色数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
roleService.checkRoleDataScope(roleId);
return success(roleService.selectRoleById(roleId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:add')")
@Log(title = "角色管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (!roleService.checkRoleNameUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(getUsername());
return toAjax(roleService.insertRole(role));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
if (!roleService.checkRoleNameUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(getUsername());
if (roleService.updateRole(role) > 0)
{
// 更新缓存用户权限
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
{
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
tokenService.setLoginUser(loginUser);
}
return success();
}
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
return toAjax(roleService.authDataScope(role));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
role.setUpdateBy(getUsername());
return toAjax(roleService.updateRoleStatus(role));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:remove')")
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{roleIds}")
public AjaxResult remove(@PathVariable Long[] roleIds)
{
return toAjax(roleService.deleteRoleByIds(roleIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
return success(roleService.selectRoleAll());
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectAllocatedList(user);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnallocatedList(user);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
roleService.checkRoleDataScope(roleId);
return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/deptTree/{roleId}")
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
return ajax;
}
}

@ -0,0 +1,251 @@
package com.bs.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.domain.entity.SysDept;
import com.bs.common.core.domain.entity.SysRole;
import com.bs.common.core.domain.entity.SysUser;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.SecurityUtils;
import com.bs.common.utils.StringUtils;
import com.bs.common.utils.poi.ExcelUtil;
import com.bs.system.service.ISysDeptService;
import com.bs.system.service.ISysPostService;
import com.bs.system.service.ISysRoleService;
import com.bs.system.service.ISysUserService;
/**
*
*
* @author bs
*/
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@Autowired
private ISysPostService postService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
}
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysUser user)
{
List<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.exportExcel(response, list, "用户数据");
}
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
Long operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.importTemplateExcel(response, "用户数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = { "/", "/{userId}" })
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
userService.checkUserDataScope(userId);
AjaxResult ajax = AjaxResult.success();
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId))
{
SysUser sysUser = userService.selectUserById(userId);
ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
}
return ajax;
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user)
{
if (!userService.checkUserNameUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
if (!userService.checkUserNameUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除");
}
return toAjax(userService.deleteUserByIds(userIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId);
ajax.put("user", user);
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return ajax;
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.checkUserDataScope(userId);
userService.insertUserAuth(userId, roleIds);
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{
return success(deptService.selectDeptTreeList(dept));
}
}

@ -0,0 +1,183 @@
package com.bs.web.controller.tool;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.R;
import com.bs.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
/**
* swagger
*
* @author bs
*/
@Api("用户信息管理")
@RestController
@RequestMapping("/test/user")
public class TestController extends BaseController
{
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
{
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
}
@ApiOperation("获取用户列表")
@GetMapping("/list")
public R<List<UserEntity>> userList()
{
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
return R.ok(userList);
}
@ApiOperation("获取用户详细")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@GetMapping("/{userId}")
public R<UserEntity> getUser(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
return R.ok(users.get(userId));
}
else
{
return R.fail("用户不存在");
}
}
@ApiOperation("新增用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
})
@PostMapping("/save")
public R<String> save(UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("更新用户")
@PutMapping("/update")
public R<String> update(@RequestBody UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
if (users.isEmpty() || !users.containsKey(user.getUserId()))
{
return R.fail("用户不存在");
}
users.remove(user.getUserId());
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("删除用户信息")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@DeleteMapping("/{userId}")
public R<String> delete(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
users.remove(userId);
return R.ok();
}
else
{
return R.fail("用户不存在");
}
}
}
@ApiModel(value = "UserEntity", description = "用户实体")
class UserEntity
{
@ApiModelProperty("用户ID")
private Integer userId;
@ApiModelProperty("用户名称")
private String username;
@ApiModelProperty("用户密码")
private String password;
@ApiModelProperty("用户手机")
private String mobile;
public UserEntity()
{
}
public UserEntity(Integer userId, String username, String password, String mobile)
{
this.userId = userId;
this.username = username;
this.password = password;
this.mobile = mobile;
}
public Integer getUserId()
{
return userId;
}
public void setUserId(Integer userId)
{
this.userId = userId;
}
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 getMobile()
{
return mobile;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
}

@ -0,0 +1,125 @@
package com.bs.web.core.config;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.bs.common.config.BsConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
/**
* Swagger2
*
* @author bs
*/
@Configuration
public class SwaggerConfig
{
/** 系统基础配置 */
@Autowired
private BsConfig bsConfig;
/** 是否开启swagger */
@Value("${swagger.enabled}")
private boolean enabled;
/** 设置请求的统一前缀 */
@Value("${swagger.pathMapping}")
private String pathMapping;
/**
* API
*/
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
// .apis(RequestHandlerSelectors.basePackage("com.bs.project.tool.swagger"))
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
/* 设置安全模式swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
.pathMapping(pathMapping);
}
/**
* tokenAuthorization
*/
private List<SecurityScheme> securitySchemes()
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
/**
*
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}
/**
*
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/**
*
*/
private ApiInfo apiInfo()
{
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题烟草管理系统_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息
.contact(new Contact(bsConfig.getName(), null, null))
// 版本
.version("版本号:" + bsConfig.getVersion())
.build();
}
}

@ -0,0 +1 @@
restart.include.json=/com.alibaba.fastjson.*.jar

@ -0,0 +1,68 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://124.71.134.146:63306/tobacco?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
username: root
password: fastrise@chain
#url: jdbc:mysql://124.71.134.146:3306/my-base?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
#username: root
#password: abcd123
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: bs
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
bs:
tenant:
#开启租户
openTenant: true

@ -0,0 +1,150 @@
# 项目相关配置
bs:
# 名称
name: bs
# 版本
version: 3.8.6
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/bs/uploadPathLinux配置 /home/bs/uploadPath
profile: D:/bs/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
level:
com.bs: debug
org.springframework: warn
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 10
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# redis 配置
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis Plus配置
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.bs.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper*.xml
# 加载全局的配置文件
#configLocation: classpath:mybatis/mybatis-config.xml
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
lazyLoadingEnabled: true
multipleResultSetsEnabled: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
use-generated-keys: true
default-executor-type: reuse
mybatis-plus-join:
#是否打印 mybatis plus join banner 默认true
banner: true
#全局启用副表逻辑删除(默认true) 关闭后关联查询不会加副表逻辑删除
sub-table-logic: true
#拦截器MappedStatement缓存(默认true)
ms-cache: true
#表别名(默认 t)
table-alias: t
#副表逻辑删除条件的位置支持where、on默认 where 1.4.4+
logic-del-type: where
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

@ -0,0 +1,24 @@
Application Version: ${bs.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////

@ -0,0 +1,38 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=用户不存在/密码错误
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号已被删除
user.blocked=用户已封禁,请联系管理员
role.blocked=角色已封禁,请联系管理员
login.blocked=很遗憾访问IP已被列入系统黑名单
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成且必须以非数字开头
user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/bs/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.bs" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
</configuration>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bs.ct.mapper.CtGalleryCataMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bs.ct.mapper.CtGalleryImagesMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bs.ct.mapper.CtGalleryCataShareMapper">
</mapper>

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

Loading…
Cancel
Save