Commit 79ab4691 authored by 刘帅's avatar 刘帅

1.init

parents
Pipeline #18 failed with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# http://editorconfig.org
root = true
# 空格替代Tab缩进在各种编辑工具下效果一致
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{json,yml,yaml}]
indent_size = 2
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
######################################################################
# Build Tools
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
target/
!.mvn/wrapper/maven-wrapper.jar
######################################################################
# IDE
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### JRebel ###
rebel.xml
### NetBeans ###
nbproject/private/
build/*
nbbuild/
nbdist/
.nb-gradle/
######################################################################
# Others
*.log
*.xml.versionsBackup
*.swp
!*/build/*.java
!*/build/*.html
!*/build/*.xml
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="propertymanagement-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="propertymanagement/propertymanagement-monitor-admin:4.8.2" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="propertymanagement-extend/propertymanagement-monitor-admin/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="propertymanagement-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="propertymanagement/propertymanagement-server:4.8.2" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="propertymanagement-admin/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="propertymanagement-xxl-job-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="propertymanagement/propertymanagement-xxl-job-admin:4.8.2" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="propertymanagement-extend/propertymanagement-xxl-job-admin/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
The MIT License (MIT)
Copyright (c) 2019 RuoYi-Vue-Plus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed.
This diff is collapsed.
FROM anapsix/alpine-java:8_server-jre_unlimited
MAINTAINER Lion Li
RUN mkdir -p /ruoyi/server/logs \
/ruoyi/server/temp \
/ruoyi/skywalking/agent
WORKDIR /ruoyi/server
ENV SERVER_PORT=8080
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-admin.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
# "-Dskywalking.agent.service_name=ruoyi-server", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar"]
<?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>propertymanagement-vue-plus</artifactId>
<groupId>com.propertyManagement</groupId>
<version>4.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>propertymanagement-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- Oracle -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<!-- PostgreSql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<!-- SqlServer -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-framework</artifactId>
</dependency>
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-system</artifactId>
</dependency>
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-job</artifactId>
</dependency>
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-oss</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-generator</artifactId>
</dependency>
<!-- demo模块 -->
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-demo</artifactId>
</dependency>
<!-- pay模块 -->
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-pay</artifactId>
</dependency>
<!-- 业务员模块 -->
<!-- <dependency>-->
<!-- <groupId>com.propertyManagement</groupId>-->
<!-- <artifactId>propertymanagement-sms</artifactId>-->
<!-- </dependency>-->
<!-- 业务员模块 -->
<dependency>
<groupId>com.propertyManagement</groupId>
<artifactId>propertymanagement-business</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- skywalking 整合 logback -->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${与你的agent探针版本保持一致}</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</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.2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.propertyManagement;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
/**
* 启动程序
*
* @author propertymanagement
*/
@SpringBootApplication
public class PropertyManagementApplication {
public static void main(String[] args) {
System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication application = new SpringApplication(PropertyManagementApplication.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);
System.out.println("(♥◠‿◠)ノ゙ PropertyManagement-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
}
}
package com.propertyManagement;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author propertymanagement
*/
public class PropertyManagementServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(PropertyManagementApplication.class);
}
}
package com.propertyManagement.web.controller.business;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.core.validate.QueryGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.business.domain.vo.WxAccountVo;
import com.propertyManagement.business.domain.bo.WxAccountBo;
import com.propertyManagement.business.service.IWxAccountService;
import com.propertyManagement.common.core.page.TableDataInfo;
/**
* 员工账号
*
* @author liushuai
* @date 2025-05-22
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/account")
public class WxAccountController extends BaseController {
private final IWxAccountService iWxAccountService;
/**
* 查询员工账号列表
*/
@SaCheckPermission("business:account:list")
@GetMapping("/list")
public TableDataInfo<WxAccountVo> list(WxAccountBo bo, PageQuery pageQuery) {
return iWxAccountService.queryPageList(bo, pageQuery);
}
/**
* 导出员工账号列表
*/
@SaCheckPermission("business:account:export")
@Log(title = "员工账号", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxAccountBo bo, HttpServletResponse response) {
List<WxAccountVo> list = iWxAccountService.queryList(bo);
ExcelUtil.exportExcel(list, "员工账号", WxAccountVo.class, response);
}
/**
* 获取员工账号详细信息
*
* @param accountId 主键
*/
@SaCheckPermission("business:account:query")
@GetMapping("/{accountId}")
public R<WxAccountVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long accountId) {
return R.ok(iWxAccountService.queryById(accountId));
}
/**
* 新增员工账号
*/
@SaCheckPermission("business:account:add")
@Log(title = "员工账号", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxAccountBo bo) {
return toAjax(iWxAccountService.insertByBo(bo));
}
/**
* 修改员工账号
*/
@SaCheckPermission("business:account:edit")
@Log(title = "员工账号", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxAccountBo bo) {
return toAjax(iWxAccountService.updateByBo(bo));
}
/**
* 删除员工账号
*
* @param accountIds 主键串
*/
@SaCheckPermission("business:account:remove")
@Log(title = "员工账号", businessType = BusinessType.DELETE)
@DeleteMapping("/{accountIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] accountIds) {
return toAjax(iWxAccountService.deleteWithValidByIds(Arrays.asList(accountIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxCarportBo;
import com.propertyManagement.business.domain.bo.WxProprietorLedgerBo;
import com.propertyManagement.business.domain.vo.WxCarportVo;
import com.propertyManagement.business.domain.vo.WxProprietorLedgerVo;
import com.propertyManagement.business.listener.WxCarportImportListener;
import com.propertyManagement.business.listener.WxProprietorLedgerImportListener;
import com.propertyManagement.business.service.IWxCarportService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.excel.ExcelResult;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 业主车位
*
* @author liushuai
* @date 2025-05-26
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/carport")
public class WxCarportController extends BaseController {
private final IWxCarportService iWxCarportService;
/**
* 查询业主车位列表
*/
@SaCheckPermission("business:carport:list")
@GetMapping("/list")
public TableDataInfo<WxCarportVo> list(WxCarportBo bo, PageQuery pageQuery) {
return iWxCarportService.queryPageList(bo, pageQuery);
}
/**
* 导出业主车位列表
*/
@SaCheckPermission("business:carport:export")
@Log(title = "业主车位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxCarportBo bo, HttpServletResponse response) {
List<WxCarportVo> list = iWxCarportService.queryList(bo);
ExcelUtil.exportExcel(list, "业主车位", WxCarportVo.class, response);
}
/**
* 业主车位导入模板下载
*/
@PostMapping("/importTemplate")
public void importTemplate(WxProprietorLedgerBo bo, HttpServletResponse response) {
ExcelUtil.exportExcel(new ArrayList<>(), "业主车位模板", WxCarportVo.class, response);
}
/**
* 导入数据
* @param file 导入文件
* @param updateSupport 是否更新已存在数据
*/
@Log(title = "业主车位导入", businessType = BusinessType.IMPORT)
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Void> importData(@RequestPart("file") MultipartFile file, Long communityId, boolean updateSupport) throws Exception {
ExcelResult<WxCarportVo> result = ExcelUtil.importExcel(file.getInputStream(), WxCarportVo.class, new WxCarportImportListener(communityId, updateSupport));
return R.ok(result.getAnalysis());
}
/**
* 获取业主车位详细信息
*
* @param carportId 主键
*/
@SaCheckPermission("business:carport:query")
@GetMapping("/{carportId}")
public R<WxCarportVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long carportId) {
return R.ok(iWxCarportService.queryById(carportId));
}
/**
* 新增业主车位
*/
@SaCheckPermission("business:carport:add")
@Log(title = "业主车位", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxCarportBo bo) {
return toAjax(iWxCarportService.insertByBo(bo));
}
/**
* 修改业主车位
*/
@SaCheckPermission("business:carport:edit")
@Log(title = "业主车位", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxCarportBo bo) {
return toAjax(iWxCarportService.updateByBo(bo));
}
/**
* 删除业主车位
*
* @param carportIds 主键串
*/
@SaCheckPermission("business:carport:remove")
@Log(title = "业主车位", businessType = BusinessType.DELETE)
@DeleteMapping("/{carportIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] carportIds) {
return toAjax(iWxCarportService.deleteWithValidByIds(Arrays.asList(carportIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxClockBo;
import com.propertyManagement.business.domain.vo.WxClockVo;
import com.propertyManagement.business.service.IWxClockService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 打卡
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/clock")
public class WxClockController extends BaseController {
private final IWxClockService iWxClockService;
/**
* 查询打卡列表
*/
@SaCheckPermission("business:clock:list")
@GetMapping("/list")
public TableDataInfo<WxClockVo> list(WxClockBo bo, PageQuery pageQuery) {
return iWxClockService.queryPageList(bo, pageQuery);
}
/**
* 导出打卡列表
*/
@SaCheckPermission("business:clock:export")
@Log(title = "打卡", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxClockBo bo, HttpServletResponse response) {
List<WxClockVo> list = iWxClockService.queryList(bo);
ExcelUtil.exportExcel(list, "打卡", WxClockVo.class, response);
}
/**
* 获取打卡详细信息
*
* @param clockId 主键
*/
@SaCheckPermission("business:clock:query")
@GetMapping("/{clockId}")
public R<WxClockVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long clockId) {
return R.ok(iWxClockService.queryById(clockId));
}
/**
* 新增打卡
*/
@SaCheckPermission("business:clock:add")
@Log(title = "打卡", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxClockBo bo) {
return toAjax(iWxClockService.insertByBo(bo));
}
/**
* 修改打卡
*/
@SaCheckPermission("business:clock:edit")
@Log(title = "打卡", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxClockBo bo) {
return toAjax(iWxClockService.updateByBo(bo));
}
/**
* 删除打卡
*
* @param clockIds 主键串
*/
@SaCheckPermission("business:clock:remove")
@Log(title = "打卡", businessType = BusinessType.DELETE)
@DeleteMapping("/{clockIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] clockIds) {
return toAjax(iWxClockService.deleteWithValidByIds(Arrays.asList(clockIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxCommentBo;
import com.propertyManagement.business.domain.vo.WxCommentVo;
import com.propertyManagement.business.service.IWxCommentService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 表扬与投诉
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/comment")
public class WxCommentController extends BaseController {
private final IWxCommentService iWxCommentService;
/**
* 查询表扬与投诉列表
*/
@SaCheckPermission("business:comment:list")
@GetMapping("/list")
public TableDataInfo<WxCommentVo> list(WxCommentBo bo, PageQuery pageQuery) {
return iWxCommentService.queryPageList(bo, pageQuery);
}
/**
* 导出表扬与投诉列表
*/
@SaCheckPermission("business:comment:export")
@Log(title = "表扬与投诉", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxCommentBo bo, HttpServletResponse response) {
List<WxCommentVo> list = iWxCommentService.queryList(bo);
ExcelUtil.exportExcel(list, "表扬与投诉", WxCommentVo.class, response);
}
/**
* 获取表扬与投诉详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:comment:query")
@GetMapping("/{id}")
public R<WxCommentVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxCommentService.queryById(id));
}
/**
* 新增表扬与投诉
*/
@SaCheckPermission("business:comment:add")
@Log(title = "表扬与投诉", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxCommentBo bo) {
return toAjax(iWxCommentService.insertByBo(bo));
}
/**
* 修改表扬与投诉
*/
@SaCheckPermission("business:comment:edit")
@Log(title = "表扬与投诉", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxCommentBo bo) {
return toAjax(iWxCommentService.updateByBo(bo));
}
/**
* 删除表扬与投诉
*
* @param ids 主键串
*/
@SaCheckPermission("business:comment:remove")
@Log(title = "表扬与投诉", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxCommentService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxCommonPhoneBo;
import com.propertyManagement.business.domain.vo.WxCommonPhoneVo;
import com.propertyManagement.business.service.IWxCommonPhoneService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 常用电话
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/commonPhone")
public class WxCommonPhoneController extends BaseController {
private final IWxCommonPhoneService iWxCommonPhoneService;
/**
* 查询常用电话列表
*/
@SaCheckPermission("business:commonPhone:list")
@GetMapping("/list")
public TableDataInfo<WxCommonPhoneVo> list(WxCommonPhoneBo bo, PageQuery pageQuery) {
return iWxCommonPhoneService.queryPageList(bo, pageQuery);
}
/**
* 导出常用电话列表
*/
@SaCheckPermission("business:commonPhone:export")
@Log(title = "常用电话", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxCommonPhoneBo bo, HttpServletResponse response) {
List<WxCommonPhoneVo> list = iWxCommonPhoneService.queryList(bo);
ExcelUtil.exportExcel(list, "常用电话", WxCommonPhoneVo.class, response);
}
/**
* 获取常用电话详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:commonPhone:query")
@GetMapping("/{id}")
public R<WxCommonPhoneVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxCommonPhoneService.queryById(id));
}
/**
* 新增常用电话
*/
@SaCheckPermission("business:commonPhone:add")
@Log(title = "常用电话", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxCommonPhoneBo bo) {
return toAjax(iWxCommonPhoneService.insertByBo(bo));
}
/**
* 修改常用电话
*/
@SaCheckPermission("business:commonPhone:edit")
@Log(title = "常用电话", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxCommonPhoneBo bo) {
return toAjax(iWxCommonPhoneService.updateByBo(bo));
}
/**
* 删除常用电话
*
* @param ids 主键串
*/
@SaCheckPermission("business:commonPhone:remove")
@Log(title = "常用电话", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxCommonPhoneService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxCommunityBo;
import com.propertyManagement.business.domain.vo.WxCommunityVo;
import com.propertyManagement.business.service.IWxCommunityService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 小区
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/community")
public class WxCommunityController extends BaseController {
private final IWxCommunityService iWxCommunityService;
/**
* 查询小区列表
*/
@SaCheckPermission("business:community:list")
@GetMapping("/list")
public TableDataInfo<WxCommunityVo> list(WxCommunityBo bo, PageQuery pageQuery) {
return iWxCommunityService.queryPageList(bo, pageQuery);
}
/**
* 查询小区列表
*/
@GetMapping("/listAll")
public R<List<WxCommunityVo>> listAll(WxCommunityBo bo) {
return R.ok(iWxCommunityService.queryList(bo));
}
/**
* 导出小区列表
*/
@SaCheckPermission("business:community:export")
@Log(title = "小区", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxCommunityBo bo, HttpServletResponse response) {
List<WxCommunityVo> list = iWxCommunityService.queryList(bo);
ExcelUtil.exportExcel(list, "小区", WxCommunityVo.class, response);
}
/**
* 获取小区详细信息
*
* @param communityId 主键
*/
@SaCheckPermission("business:community:query")
@GetMapping("/{communityId}")
public R<WxCommunityVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long communityId) {
return R.ok(iWxCommunityService.queryById(communityId));
}
/**
* 新增小区
*/
@SaCheckPermission("business:community:add")
@Log(title = "小区", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxCommunityBo bo) {
return toAjax(iWxCommunityService.insertByBo(bo));
}
/**
* 修改小区
*/
@SaCheckPermission("business:community:edit")
@Log(title = "小区", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxCommunityBo bo) {
return toAjax(iWxCommunityService.updateByBo(bo));
}
/**
* 删除小区
*
* @param communityIds 主键串
*/
@SaCheckPermission("business:community:remove")
@Log(title = "小区", businessType = BusinessType.DELETE)
@DeleteMapping("/{communityIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] communityIds) {
return toAjax(iWxCommunityService.deleteWithValidByIds(Arrays.asList(communityIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxFamilyMemberBo;
import com.propertyManagement.business.domain.vo.WxFamilyMemberVo;
import com.propertyManagement.business.service.IWxFamilyMemberService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 家庭成员
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/familyMember")
public class WxFamilyMemberController extends BaseController {
private final IWxFamilyMemberService iWxFamilyMemberService;
/**
* 查询家庭成员列表
*/
@SaCheckPermission("business:familyMember:list")
@GetMapping("/list")
public TableDataInfo<WxFamilyMemberVo> list(WxFamilyMemberBo bo, PageQuery pageQuery) {
return iWxFamilyMemberService.queryPageList(bo, pageQuery);
}
/**
* 查询家庭成员列表
*/
@SaCheckPermission("business:familyMember:list")
@GetMapping("/listAll")
public R<List<WxFamilyMemberVo>> listAll(WxFamilyMemberBo bo) {
return R.ok(iWxFamilyMemberService.queryList(bo));
}
/**
* 导出家庭成员列表
*/
@SaCheckPermission("business:familyMember:export")
@Log(title = "家庭成员", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxFamilyMemberBo bo, HttpServletResponse response) {
List<WxFamilyMemberVo> list = iWxFamilyMemberService.queryList(bo);
ExcelUtil.exportExcel(list, "家庭成员", WxFamilyMemberVo.class, response);
}
/**
* 获取家庭成员详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:familyMember:query")
@GetMapping("/{id}")
public R<WxFamilyMemberVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxFamilyMemberService.queryById(id));
}
/**
* 新增家庭成员
*/
@SaCheckPermission("business:familyMember:add")
@Log(title = "家庭成员", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxFamilyMemberBo bo) {
return toAjax(iWxFamilyMemberService.insertByBo(bo));
}
/**
* 修改家庭成员
*/
@SaCheckPermission("business:familyMember:edit")
@Log(title = "家庭成员", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxFamilyMemberBo bo) {
return toAjax(iWxFamilyMemberService.updateByBo(bo));
}
/**
* 删除家庭成员
*
* @param ids 主键串
*/
@SaCheckPermission("business:familyMember:remove")
@Log(title = "家庭成员", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxFamilyMemberService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxGuestBo;
import com.propertyManagement.business.domain.vo.WxGuestVo;
import com.propertyManagement.business.service.IWxGuestService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 访客
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/guest")
public class WxGuestController extends BaseController {
private final IWxGuestService iWxGuestService;
/**
* 查询访客列表
*/
@SaCheckPermission("business:guest:list")
@GetMapping("/list")
public TableDataInfo<WxGuestVo> list(WxGuestBo bo, PageQuery pageQuery) {
return iWxGuestService.queryPageList(bo, pageQuery);
}
/**
* 导出访客列表
*/
@SaCheckPermission("business:guest:export")
@Log(title = "访客", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxGuestBo bo, HttpServletResponse response) {
List<WxGuestVo> list = iWxGuestService.queryList(bo);
ExcelUtil.exportExcel(list, "访客", WxGuestVo.class, response);
}
/**
* 获取访客详细信息
*
* @param guestId 主键
*/
@SaCheckPermission("business:guest:query")
@GetMapping("/{guestId}")
public R<WxGuestVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long guestId) {
return R.ok(iWxGuestService.queryById(guestId));
}
/**
* 新增访客
*/
@SaCheckPermission("business:guest:add")
@Log(title = "访客", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxGuestBo bo) {
return toAjax(iWxGuestService.insertByBo(bo));
}
/**
* 修改访客
*/
@SaCheckPermission("business:guest:edit")
@Log(title = "访客", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxGuestBo bo) {
return toAjax(iWxGuestService.updateByBo(bo));
}
/**
* 删除访客
*
* @param guestIds 主键串
*/
@SaCheckPermission("business:guest:remove")
@Log(title = "访客", businessType = BusinessType.DELETE)
@DeleteMapping("/{guestIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] guestIds) {
return toAjax(iWxGuestService.deleteWithValidByIds(Arrays.asList(guestIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxLiveBill;
import com.propertyManagement.business.domain.bo.WxLiveBillBo;
import com.propertyManagement.business.domain.vo.WxLiveBillVo;
import com.propertyManagement.business.mapper.WxLiveBillMapper;
import com.propertyManagement.business.service.IWxLiveBillService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 生活缴费账单
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/liveBill")
public class WxLiveBillController extends BaseController {
private final IWxLiveBillService iWxLiveBillService;
private final WxLiveBillMapper wxLiveBillMapper;
/**
* 查询生活缴费账单列表
*/
@SaCheckPermission("business:liveBill:list")
@GetMapping("/list")
public TableDataInfo<WxLiveBillVo> list(WxLiveBillBo bo, PageQuery pageQuery) {
return iWxLiveBillService.queryPageList(bo, pageQuery);
}
/**
* 导出生活缴费账单列表
*/
@SaCheckPermission("business:liveBill:export")
@Log(title = "生活缴费账单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxLiveBillBo bo, HttpServletResponse response) {
List<WxLiveBillVo> list = iWxLiveBillService.queryList(bo);
ExcelUtil.exportExcel(list, "生活缴费账单", WxLiveBillVo.class, response);
}
/**
* 获取生活缴费账单详细信息
*
* @param billId 主键
*/
@SaCheckPermission("business:liveBill:query")
@GetMapping("/{billId}")
public R<WxLiveBillVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long billId) {
return R.ok(iWxLiveBillService.queryById(billId));
}
/**
* 新增生活缴费账单
*/
@SaCheckPermission("business:liveBill:add")
@Log(title = "生活缴费账单", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxLiveBillBo bo) {
return toAjax(iWxLiveBillService.insertByBo(bo));
}
/**
* 修改生活缴费账单
*/
@SaCheckPermission("business:liveBill:edit")
@Log(title = "生活缴费账单", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxLiveBillBo bo) {
return toAjax(iWxLiveBillService.updateByBo(bo));
}
/**
* 删除生活缴费账单
*
* @param billIds 主键串
*/
@SaCheckPermission("business:liveBill:remove")
@Log(title = "生活缴费账单", businessType = BusinessType.DELETE)
@DeleteMapping("/{billIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] billIds) {
return toAjax(iWxLiveBillService.deleteWithValidByIds(Arrays.asList(billIds), true));
}
/**
* 确认缴费账单
*
* @param billIds 主键串
*/
@Log(title = "确认缴费账单", businessType = BusinessType.UPDATE)
@PutMapping("/confirm/{billIds}")
public R<Void> confirm(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] billIds) {
LambdaUpdateWrapper<WxLiveBill> updateWrapper = Wrappers.lambdaUpdate();
updateWrapper.in(WxLiveBill::getBillId, billIds);
updateWrapper.set(WxLiveBill::getState, 2);
wxLiveBillMapper.update(updateWrapper);
return toAjax( wxLiveBillMapper.update(updateWrapper));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxPayRecordBo;
import com.propertyManagement.business.domain.vo.WxPayRecordVo;
import com.propertyManagement.business.service.IWxPayRecordService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 缴费记录
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/payRecord")
public class WxPayRecordController extends BaseController {
private final IWxPayRecordService iWxPayRecordService;
/**
* 查询缴费记录列表
*/
@SaCheckPermission("business:payRecord:list")
@GetMapping("/list")
public TableDataInfo<WxPayRecordVo> list(WxPayRecordBo bo, PageQuery pageQuery) {
return iWxPayRecordService.queryPageList(bo, pageQuery);
}
/**
* 导出缴费记录列表
*/
@SaCheckPermission("business:payRecord:export")
@Log(title = "缴费记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxPayRecordBo bo, HttpServletResponse response) {
List<WxPayRecordVo> list = iWxPayRecordService.queryList(bo);
ExcelUtil.exportExcel(list, "缴费记录", WxPayRecordVo.class, response);
}
/**
* 获取缴费记录详细信息
*
* @param recordId 主键
*/
@SaCheckPermission("business:payRecord:query")
@GetMapping("/{recordId}")
public R<WxPayRecordVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long recordId) {
return R.ok(iWxPayRecordService.queryById(recordId));
}
/**
* 新增缴费记录
*/
@SaCheckPermission("business:payRecord:add")
@Log(title = "缴费记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxPayRecordBo bo) {
return toAjax(iWxPayRecordService.insertByBo(bo));
}
/**
* 修改缴费记录
*/
@SaCheckPermission("business:payRecord:edit")
@Log(title = "缴费记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxPayRecordBo bo) {
return toAjax(iWxPayRecordService.updateByBo(bo));
}
/**
* 删除缴费记录
*
* @param recordIds 主键串
*/
@SaCheckPermission("business:payRecord:remove")
@Log(title = "缴费记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] recordIds) {
return toAjax(iWxPayRecordService.deleteWithValidByIds(Arrays.asList(recordIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxProprietorLedgerBo;
import com.propertyManagement.business.domain.vo.WxProprietorLedgerVo;
import com.propertyManagement.business.listener.WxProprietorLedgerImportListener;
import com.propertyManagement.business.service.IWxProprietorLedgerService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.excel.ExcelResult;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 小区业主台账信息
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/proprietorLedger")
public class WxProprietorLedgerController extends BaseController {
private final IWxProprietorLedgerService iWxProprietorLedgerService;
/**
* 查询小区业主台账信息列表
*/
@SaCheckPermission("business:proprietorLedger:list")
@GetMapping("/list")
public TableDataInfo<WxProprietorLedgerVo> list(WxProprietorLedgerBo bo, PageQuery pageQuery) {
return iWxProprietorLedgerService.queryPageList(bo, pageQuery);
}
/**
* 查询小区业主台账信息列表
*/
@SaCheckPermission("business:proprietorLedger:list")
@GetMapping("/listAll")
public R<List<WxProprietorLedgerVo>> listAll(WxProprietorLedgerBo bo) {
return R.ok(iWxProprietorLedgerService.queryList(bo));
}
/**
* 导出小区业主台账信息列表
*/
@SaCheckPermission("business:proprietorLedger:export")
@Log(title = "小区业主台账信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxProprietorLedgerBo bo, HttpServletResponse response) {
List<WxProprietorLedgerVo> list = iWxProprietorLedgerService.queryList(bo);
ExcelUtil.exportExcel(list, "小区业主台账信息", WxProprietorLedgerVo.class, response);
}
/**
* 业主台账导入模板下载
*/
@PostMapping("/importTemplate")
public void importTemplate(WxProprietorLedgerBo bo, HttpServletResponse response) {
ExcelUtil.exportExcel(new ArrayList<>(), "业主台账模板", WxProprietorLedgerVo.class, response);
}
/**
* 导入数据
*
* @param file 导入文件
* @param updateSupport 是否更新已存在数据
*/
@Log(title = "业主台账导入", businessType = BusinessType.IMPORT)
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Void> importData(@RequestPart("file") MultipartFile file, Long communityId, boolean updateSupport) throws Exception {
ExcelResult<WxProprietorLedgerVo> result = ExcelUtil.importExcel(file.getInputStream(), WxProprietorLedgerVo.class, new WxProprietorLedgerImportListener(communityId, updateSupport));
return R.ok(result.getAnalysis());
}
/**
* 获取小区业主台账信息详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:proprietorLedger:query")
@GetMapping("/{id}")
public R<WxProprietorLedgerVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxProprietorLedgerService.queryById(id));
}
/**
* 新增小区业主台账信息
*/
@SaCheckPermission("business:proprietorLedger:add")
@Log(title = "小区业主台账信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxProprietorLedgerBo bo) {
return toAjax(iWxProprietorLedgerService.insertByBo(bo));
}
/**
* 修改小区业主台账信息
*/
@SaCheckPermission("business:proprietorLedger:edit")
@Log(title = "小区业主台账信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxProprietorLedgerBo bo) {
return toAjax(iWxProprietorLedgerService.updateByBo(bo));
}
/**
* 删除小区业主台账信息
*
* @param ids 主键串
*/
@SaCheckPermission("business:proprietorLedger:remove")
@Log(title = "小区业主台账信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxProprietorLedgerService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxProtocolBo;
import com.propertyManagement.business.domain.vo.WxProtocolVo;
import com.propertyManagement.business.service.IWxProtocolService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 用户协议
*
* @author liushuai
* @date 2025-05-24
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/protocol")
public class WxProtocolController extends BaseController {
private final IWxProtocolService iWxProtocolService;
/**
* 查询用户协议列表
*/
@SaCheckPermission("business:protocol:list")
@GetMapping("/list")
public TableDataInfo<WxProtocolVo> list(WxProtocolBo bo, PageQuery pageQuery) {
return iWxProtocolService.queryPageList(bo, pageQuery);
}
/**
* 导出用户协议列表
*/
@SaCheckPermission("business:protocol:export")
@Log(title = "用户协议", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxProtocolBo bo, HttpServletResponse response) {
List<WxProtocolVo> list = iWxProtocolService.queryList(bo);
ExcelUtil.exportExcel(list, "用户协议", WxProtocolVo.class, response);
}
/**
* 获取用户协议详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:protocol:query")
@GetMapping("/{id}")
public R<WxProtocolVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxProtocolService.queryById(id));
}
/**
* 新增用户协议
*/
@SaCheckPermission("business:protocol:add")
@Log(title = "用户协议", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxProtocolBo bo) {
return toAjax(iWxProtocolService.insertByBo(bo));
}
/**
* 修改用户协议
*/
@SaCheckPermission("business:protocol:edit")
@Log(title = "用户协议", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxProtocolBo bo) {
return toAjax(iWxProtocolService.updateByBo(bo));
}
/**
* 删除用户协议
*
* @param ids 主键串
*/
@SaCheckPermission("business:protocol:remove")
@Log(title = "用户协议", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxProtocolService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxRepairsBo;
import com.propertyManagement.business.domain.vo.WxRepairsVo;
import com.propertyManagement.business.service.IWxRepairsService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 报修
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/repairs")
public class WxRepairsController extends BaseController {
private final IWxRepairsService iWxRepairsService;
/**
* 查询报修列表
*/
@SaCheckPermission("business:repairs:list")
@GetMapping("/list")
public TableDataInfo<WxRepairsVo> list(WxRepairsBo bo, PageQuery pageQuery) {
return iWxRepairsService.queryPageList(bo, pageQuery);
}
/**
* 导出报修列表
*/
@SaCheckPermission("business:repairs:export")
@Log(title = "报修", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxRepairsBo bo, HttpServletResponse response) {
List<WxRepairsVo> list = iWxRepairsService.queryList(bo);
ExcelUtil.exportExcel(list, "报修", WxRepairsVo.class, response);
}
/**
* 获取报修详细信息
*
* @param repairsId 主键
*/
@SaCheckPermission("business:repairs:query")
@GetMapping("/{repairsId}")
public R<WxRepairsVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long repairsId) {
return R.ok(iWxRepairsService.queryById(repairsId));
}
/**
* 新增报修
*/
@SaCheckPermission("business:repairs:add")
@Log(title = "报修", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxRepairsBo bo) {
return toAjax(iWxRepairsService.insertByBo(bo));
}
/**
* 修改报修
*/
@SaCheckPermission("business:repairs:edit")
@Log(title = "报修", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxRepairsBo bo) {
return toAjax(iWxRepairsService.updateByBo(bo));
}
/**
* 删除报修
*
* @param repairsIds 主键串
*/
@SaCheckPermission("business:repairs:remove")
@Log(title = "报修", businessType = BusinessType.DELETE)
@DeleteMapping("/{repairsIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] repairsIds) {
return toAjax(iWxRepairsService.deleteWithValidByIds(Arrays.asList(repairsIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxRuleBo;
import com.propertyManagement.business.domain.vo.WxRuleVo;
import com.propertyManagement.business.service.IWxRuleService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 规则说明
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/rule")
public class WxRuleController extends BaseController {
private final IWxRuleService iWxRuleService;
/**
* 查询规则说明列表
*/
@SaCheckPermission("business:rule:list")
@GetMapping("/list")
public TableDataInfo<WxRuleVo> list(WxRuleBo bo, PageQuery pageQuery) {
return iWxRuleService.queryPageList(bo, pageQuery);
}
/**
* 导出规则说明列表
*/
@SaCheckPermission("business:rule:export")
@Log(title = "规则说明", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxRuleBo bo, HttpServletResponse response) {
List<WxRuleVo> list = iWxRuleService.queryList(bo);
ExcelUtil.exportExcel(list, "规则说明", WxRuleVo.class, response);
}
/**
* 获取规则说明详细信息
*
* @param ruleId 主键
*/
@SaCheckPermission("business:rule:query")
@GetMapping("/{ruleId}")
public R<WxRuleVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long ruleId) {
return R.ok(iWxRuleService.queryById(ruleId));
}
/**
* 新增规则说明
*/
@SaCheckPermission("business:rule:add")
@Log(title = "规则说明", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxRuleBo bo) {
return toAjax(iWxRuleService.insertByBo(bo));
}
/**
* 修改规则说明
*/
@SaCheckPermission("business:rule:edit")
@Log(title = "规则说明", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxRuleBo bo) {
return toAjax(iWxRuleService.updateByBo(bo));
}
/**
* 删除规则说明
*
* @param ruleIds 主键串
*/
@SaCheckPermission("business:rule:remove")
@Log(title = "规则说明", businessType = BusinessType.DELETE)
@DeleteMapping("/{ruleIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ruleIds) {
return toAjax(iWxRuleService.deleteWithValidByIds(Arrays.asList(ruleIds), true));
}
}
package com.propertyManagement.web.controller.business;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxUserCommunityLedgerBo;
import com.propertyManagement.business.domain.vo.WxUserCommunityLedgerVo;
import com.propertyManagement.business.service.IWxUserCommunityLedgerService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 用户、小区、台账关联报
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/userCommunityLedger")
public class WxUserCommunityLedgerController extends BaseController {
private final IWxUserCommunityLedgerService iWxUserCommunityLedgerService;
/**
* 查询用户、小区、台账关联报列表
*/
@SaCheckPermission("business:userCommunityLedger:list")
@GetMapping("/list")
public TableDataInfo<WxUserCommunityLedgerVo> list(WxUserCommunityLedgerBo bo, PageQuery pageQuery) {
return iWxUserCommunityLedgerService.queryPageList(bo, pageQuery);
}
/**
* 导出用户、小区、台账关联报列表
*/
@SaCheckPermission("business:userCommunityLedger:export")
@Log(title = "用户、小区、台账关联报", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxUserCommunityLedgerBo bo, HttpServletResponse response) {
List<WxUserCommunityLedgerVo> list = iWxUserCommunityLedgerService.queryList(bo);
ExcelUtil.exportExcel(list, "用户、小区、台账关联报", WxUserCommunityLedgerVo.class, response);
}
/**
* 获取用户、小区、台账关联报详细信息
*
* @param userId 主键
*/
@SaCheckPermission("business:userCommunityLedger:query")
@GetMapping("/{userId}")
public R<WxUserCommunityLedgerVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long userId) {
return R.ok(iWxUserCommunityLedgerService.queryById(userId));
}
/**
* 新增用户、小区、台账关联报
*/
@SaCheckPermission("business:userCommunityLedger:add")
@Log(title = "用户、小区、台账关联报", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxUserCommunityLedgerBo bo) {
return toAjax(iWxUserCommunityLedgerService.insertByBo(bo));
}
/**
* 修改用户、小区、台账关联报
*/
@SaCheckPermission("business:userCommunityLedger:edit")
@Log(title = "用户、小区、台账关联报", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxUserCommunityLedgerBo bo) {
return toAjax(iWxUserCommunityLedgerService.updateByBo(bo));
}
/**
* 删除用户、小区、台账关联报
*
* @param userIds 主键串
*/
@SaCheckPermission("business:userCommunityLedger:remove")
@Log(title = "用户、小区、台账关联报", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] userIds) {
return toAjax(iWxUserCommunityLedgerService.deleteWithValidByIds(Arrays.asList(userIds), true));
}
}
package com.propertyManagement.web.controller.business;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.business.domain.vo.WxUserVo;
import com.propertyManagement.business.domain.bo.WxUserBo;
import com.propertyManagement.business.service.IWxUserService;
import com.propertyManagement.common.core.page.TableDataInfo;
/**
* 微信用户
*
* @author liushuai
* @date 2025-05-13
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/user")
public class WxUserController extends BaseController {
private final IWxUserService iWxUserService;
/**
* 查询微信用户列表
*/
@SaCheckPermission("business:user:list")
@GetMapping("/list")
public TableDataInfo<WxUserVo> list(WxUserBo bo, PageQuery pageQuery) {
return iWxUserService.queryPageList(bo, pageQuery);
}
/**
* 导出微信用户列表
*/
@SaCheckPermission("business:user:export")
@Log(title = "微信用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WxUserBo bo, HttpServletResponse response) {
List<WxUserVo> list = iWxUserService.queryList(bo);
ExcelUtil.exportExcel(list, "微信用户", WxUserVo.class, response);
}
/**
* 获取微信用户详细信息
*
* @param id 主键
*/
@SaCheckPermission("business:user:query")
@GetMapping("/{id}")
public R<WxUserVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxUserService.queryById(id));
}
/**
* 新增微信用户
*/
@SaCheckPermission("business:user:add")
@Log(title = "微信用户", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxUserBo bo) {
return toAjax(iWxUserService.insertByBo(bo));
}
/**
* 修改微信用户
*/
@SaCheckPermission("business:user:edit")
@Log(title = "微信用户", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxUserBo bo) {
return toAjax(iWxUserService.updateByBo(bo));
}
/**
* 删除微信用户
*
* @param ids 主键串
*/
@SaCheckPermission("business:user:remove")
@Log(title = "微信用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iWxUserService.deleteWithValidByIds(Arrays.asList(ids), true));
}
}
package com.propertyManagement.web.controller.business.api;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxAccount;
import com.propertyManagement.business.domain.bo.CodeLoginBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.mapper.WxAccountMapper;
import com.propertyManagement.business.service.WxUserLoginService;
import com.propertyManagement.business.service.WxUserTokenService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.business.support.util.SendSms;
import com.propertyManagement.common.annotation.Anonymous;
import com.propertyManagement.common.constant.CacheConstants;
import com.propertyManagement.common.core.domain.LoginResult;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.utils.VerifyCodeUtils;
import com.propertyManagement.common.utils.redis.RedisUtils;
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.Duration;
import java.util.List;
/**
* 小程序登录
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/login")
public class ApiLoginController {
private final WxUserLoginService wxUserLoginService;
private final WxAccountMapper accountMapper;
private final WxUserTokenService wxUserTokenService;
private final SendSms sendSms;
/**
* 小程序静默授权登录
*
* @param bo 登录信息
* @return 结果
*/
// @Operation(summary = "小程序静默授权登录")
// @Anonymous
// @PostMapping("/code")
// public R<LoginResult<LoginWxUser>> codeLogin(@RequestBody CodeLoginBo bo) {
// // 生成令牌
// LoginResult loginResult = wxUserLoginService.codeLogin(bo);
// return R.ok(loginResult);
// }
/**
* 小程序手机号授权登录
*
* @param dto 登录信息
* @return 结果
*/
@Operation(summary = "小程序手机号授权登录")
@Anonymous
@PostMapping("/mobile")
public R<LoginResult<LoginWxUser>> codeMobilLogin(@RequestBody CodeLoginBo dto) {
// 生成令牌
LoginResult loginResult = wxUserLoginService.codeMobilLogin(dto);
return R.ok(loginResult);
}
/**
* 发送短信验证码
* @param mobile 手机号
* @return OK
*/
@GetMapping("/sendSmsCode")
public R<String> sendSmsCode(@Validated @Parameter(description = "手机号") @NotNull(message = "手机号不能为空") String mobile) {
String code = VerifyCodeUtils.generateNumberCode(6);
String[] phoneNumbers = new String[]{"+86" + mobile}; // 中国号码格式
String[] templateParams = new String[]{code}; // 模板参数
SendStatus[] sendStatuses = sendSms.send(phoneNumbers, templateParams);
if (null == sendStatuses) {
return R.fail("短信发送失败,请联系管理员");
}
SendStatus sendStatus = sendStatuses[0];
if (!sendStatus.getCode().equals("Ok")) {
return R.fail("短信发送失败,原因:" + sendStatus.getMessage());
}
RedisUtils.setCacheObject(CacheConstants.GUEST_PHONE_CODES + mobile, code, Duration.ofMinutes(5));
return R.ok("短信发送成功");
}
/**
* 员工登录
* @param account 账号
* @param password 密码
* @return OK
*/
@GetMapping("/accountLogin/{account}/{password}")
public R<LoginWxUser> accountLogin(@NotEmpty(message = "账号不能为空") @PathVariable String account,
@NotEmpty(message = "密码不能为空") @PathVariable String password) {
LoginWxUser wxUser = AuthUtil.getWxUser();
LambdaQueryWrapper<WxAccount> accountLambdaQueryWrapper = Wrappers.lambdaQuery();
accountLambdaQueryWrapper.eq(WxAccount::getAccount, account).eq(WxAccount::getPossword, password);
WxAccount wxAccount = accountMapper.selectOne(accountLambdaQueryWrapper);
if (wxAccount == null) {
return R.fail("登录失败,账号或密码错误");
}
wxUser.setAccountId(wxAccount.getAccountId());
wxUser.setAccount(wxAccount.getAccount());
wxUser.setAccountName(wxAccount.getName());
wxUser.setAccountMobile(wxAccount.getMobile());
wxUser.setAccountType(wxAccount.getType());
wxUserTokenService.refreshToken(wxUser);
return R.ok(wxUser);
}
/**
* 用户详情
* @return OK
*/
@GetMapping("/userInfo")
public R<LoginWxUser> userInfo() {
LoginWxUser wxUser = AuthUtil.getWxUser();
wxUserTokenService.refreshToken(wxUser);
LoginWxUser loginWxUser = RedisUtils.getCacheObject(CacheConstants.LOGIN_MERCHANT_TOKEN_KEY + wxUser.getToken());
return R.ok(loginWxUser);
}
}
package com.propertyManagement.web.controller.business.api;
import cn.hutool.core.util.ObjectUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.system.domain.vo.SysOssVo;
import com.propertyManagement.system.service.ISysOssService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.Map;
/**
* 文件上传
*
* @author liushuai
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/oss")
public class ApiSysOssController extends BaseController {
private final ISysOssService iSysOssService;
/**
* 上传OSS对象存储
*
* @param file 文件
*/
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) {
if (ObjectUtil.isNull(file)) {
return R.fail("上传文件不能为空");
}
SysOssVo oss = iSysOssService.upload(file);
Map<String, String> map = new HashMap<>(2);
map.put("url", oss.getUrl());
map.put("fileName", oss.getOriginalName());
map.put("ossId", oss.getOssId().toString());
return R.ok(map);
}
}
package com.propertyManagement.web.controller.business.api;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxClock;
import com.propertyManagement.business.domain.bo.WxClockBo;
import com.propertyManagement.business.domain.vo.WxClockVo;
import com.propertyManagement.business.domain.vo.WxClockVo2;
import com.propertyManagement.business.mapper.WxClockMapper;
import com.propertyManagement.business.service.IWxClockService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* 打卡
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/clock")
public class ApiWxClockController extends BaseController {
private final IWxClockService iWxClockService;
private final WxClockMapper wxClockMapper;
/**
* 查询打卡列表
*/
@GetMapping("/listAll")
public R<WxClockVo2> list() {
Long accountId = AuthUtil.getWxUser().getAccountId();
WxClockVo2 wxClockVo2 = new WxClockVo2();
// 获取本月第一天和最后一天
DateTime beginOfMonth = DateUtil.beginOfMonth(DateUtil.date());
DateTime endOfMonth = DateUtil.endOfMonth(DateUtil.date());
// 生成本月所有日期列表
List<DateTime> dateTimes = DateUtil.rangeToList(beginOfMonth, endOfMonth, DateField.DAY_OF_MONTH);
// 并行处理提高效率
List<WxClockVo2.ClockRecord> clockRecordList = dateTimes.parallelStream()
.map(item -> {
String dateStr = DateUtil.format(item, "yyyy-MM-dd");
int count = Math.toIntExact(wxClockMapper.selectCount(Wrappers.<WxClock>lambdaQuery()
.apply("DATE(clock_time) = {0}", dateStr)
.eq(WxClock::getAccountId, accountId)));
return new WxClockVo2.ClockRecord(dateStr, count > 0 ? 1 : 0);
})
.collect(Collectors.toList());
// 计算打卡和缺卡天数
long clockDays = clockRecordList.stream().filter(r -> r.getClockState() == 1).count();
wxClockVo2.setClockDay((int) clockDays);
wxClockVo2.setNoRecordDay(clockRecordList.size() - (int) clockDays);
wxClockVo2.setClockRecordList(clockRecordList);
return R.ok(wxClockVo2);
}
/**
* 获取打卡详细信息
*
* @param date 日期
*/
@GetMapping("/record/{date}")
public R<List<WxClockVo>> getInfo(@NotEmpty(message = "日期不能为空") @PathVariable String date) {
LambdaQueryWrapper<WxClock> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.apply("DATE(clock_time) = {0}", date).eq(WxClock::getAccountId, AuthUtil.getWxUser().getAccountId());
return R.ok(wxClockMapper.selectVoList(queryWrapper));
}
/**
* 新增打卡
*/
@RepeatSubmit()
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxClockBo bo) {
return toAjax(iWxClockService.add(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.business.domain.WxComment;
import com.propertyManagement.business.domain.bo.WxCommentBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxCommentVo;
import com.propertyManagement.business.mapper.WxCommentMapper;
import com.propertyManagement.business.service.IWxCommentService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.RepairsState;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 表扬与投诉
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/comment")
public class ApiWxCommentController extends BaseController {
private final IWxCommentService iWxCommentService;
private final WxCommentMapper wxCommentMapper;
/**
* 查询用户历史工单列表
*/
@GetMapping("/userListAll")
public R<List<WxCommentVo>> list(WxCommentBo bo) {
LoginWxUser wxUser = AuthUtil.getWxUser();
bo.setCommunityId(wxUser.getCommunityId());
bo.setUserId(wxUser.getId());
return R.ok(iWxCommentService.queryList(bo));
}
/**
* 获取表扬与投诉详细信息
*
* @param id 主键
*/
@GetMapping("/{id}")
public R<WxCommentVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iWxCommentService.queryById(id));
}
/**
* 新增表扬与投诉
*/
@RepeatSubmit()
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxCommentBo bo) {
return toAjax(iWxCommentService.add(bo));
}
/**
* 取消表扬或投诉
*
* @param id 主键
*/
@PutMapping("/cancel/{id}")
public R<Void> cancel(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
WxComment wxComment = wxCommentMapper.selectById(id);
if (wxComment == null) {
return R.fail("取消失败,工单不存在");
}
if (!wxComment.getState().equals(RepairsState.ONE.getCode())) {
return R.fail("取消失败,工单状态错误");
}
wxComment.setState(3);
wxComment.setCloseTime(new Date());
wxCommentMapper.updateById(wxComment);
return toAjax(true);
}
}
package com.propertyManagement.web.controller.business.api;
import com.propertyManagement.business.domain.bo.WxCommonPhoneBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxCommonPhoneVo;
import com.propertyManagement.business.service.IWxCommonPhoneService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 常用电话
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/commonPhone")
public class ApiWxCommonPhoneController extends BaseController {
private final IWxCommonPhoneService iWxCommonPhoneService;
/**
* 查询常用电话列表
*/
@GetMapping("/listAll")
public R<List<WxCommonPhoneVo>> list(WxCommonPhoneBo bo) {
LoginWxUser wxUser = AuthUtil.getWxUser();
bo.setCommunityId(wxUser.getCommunityId());
return R.ok(iWxCommonPhoneService.queryList(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxCarport;
import com.propertyManagement.business.domain.WxProprietorLedger;
import com.propertyManagement.business.domain.WxUserCommunityLedger;
import com.propertyManagement.business.domain.bo.WxCommunityBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxCarportVo;
import com.propertyManagement.business.domain.vo.WxCommunityVo;
import com.propertyManagement.business.domain.vo.WxProprietorLedgerVo;
import com.propertyManagement.business.mapper.WxCarportMapper;
import com.propertyManagement.business.mapper.WxProprietorLedgerMapper;
import com.propertyManagement.business.mapper.WxUserCommunityLedgerMapper;
import com.propertyManagement.business.service.IWxCommunityService;
import com.propertyManagement.business.service.WxUserTokenService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.LoginResult;
import com.propertyManagement.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
/**
* 小区
*
* @author liushuai
* @date 2025-05-20
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/community")
public class ApiWxCommunityController extends BaseController {
private final IWxCommunityService iWxCommunityService;
private final WxUserTokenService wxUserTokenService;
private final WxUserCommunityLedgerMapper wxUserCommunityLedgerMapper;
private final WxProprietorLedgerMapper wxProprietorLedgerMapper;
private final WxCarportMapper wxCarportMapper;
/**
* 小区列表
*/
@GetMapping("/listAll")
public R<List<WxCommunityVo>> listAll(WxCommunityBo bo) {
return R.ok(iWxCommunityService.queryList(bo));
}
/**
* 根据小区ID查询户号列表
*/
@GetMapping("/room/listAllByCommunityId/{communityId}")
public R<List<WxProprietorLedgerVo>> roomListAll(@PathVariable Long communityId) {
/**
* 根据小区与当前用户查询用户与小区台账关联关系表
*/
LambdaQueryWrapper<WxUserCommunityLedger> ledgerLambdaQueryWrapper = Wrappers.lambdaQuery();
ledgerLambdaQueryWrapper.eq(WxUserCommunityLedger::getCommunityId, communityId);
ledgerLambdaQueryWrapper.eq(WxUserCommunityLedger::getUserId, AuthUtil.getWxUser().getId());
List<WxUserCommunityLedger> communityLedgers = wxUserCommunityLedgerMapper.selectList(ledgerLambdaQueryWrapper);
/**
* 根据台账ID列表查询台账信息
*/
List<Long> collect = communityLedgers.stream().map(WxUserCommunityLedger::getProprietorId).collect(Collectors.toList());
if (!collect.isEmpty()) {
return R.ok(wxProprietorLedgerMapper.selectVoBatchIds(collect));
}
return R.ok();
}
/**
* 切换小区及户号
*/
@PostMapping("/cut/{communityId}/{proprietorId}")
public R<LoginWxUser> cutCommunity(@PathVariable Long communityId, @PathVariable Long proprietorId) {
WxProprietorLedger proprietorLedger = wxProprietorLedgerMapper.selectById(proprietorId);
LoginWxUser wxUser = AuthUtil.getWxUser();
wxUser.setCommunityId(communityId);
wxUser.setCommunityName(proprietorLedger.getCommunityName());
wxUser.setProprietorId(proprietorId);
wxUser.setRoom(proprietorLedger.getRoom());
wxUser.setName(proprietorLedger.getName());
wxUser.setSqm(proprietorLedger.getSqm());
/**
* 查询车位信息
*/
LambdaQueryWrapper<WxCarport> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(WxCarport::getProprietorId, proprietorId);
List<WxCarportVo> carportVoList = wxCarportMapper.selectVoList(queryWrapper);
if (!carportVoList.isEmpty()) {
wxUser.setCarportVoList(carportVoList);
}
wxUserTokenService.refreshToken(wxUser);
return R.ok(wxUser);
}
/**
* 我的房屋列表
*/
@GetMapping("/myRoomListAll")
public R<List<WxProprietorLedger>> myRoomListAll() {
LoginWxUser wxUser = AuthUtil.getWxUser();
LambdaQueryWrapper<WxUserCommunityLedger> wxUserCommunityLedgerLambdaQueryWrapper = Wrappers.lambdaQuery();
wxUserCommunityLedgerLambdaQueryWrapper.eq(WxUserCommunityLedger::getUserId, wxUser.getId());
List<WxUserCommunityLedger> ledgerList = wxUserCommunityLedgerMapper.selectList(wxUserCommunityLedgerLambdaQueryWrapper);
if (ledgerList.isEmpty()) {
return R.ok();
}
LambdaQueryWrapper<WxProprietorLedger> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.in(WxProprietorLedger::getProprietorId, ledgerList.stream().map(WxUserCommunityLedger::getProprietorId).collect(Collectors.toList()));
List<WxProprietorLedger> selectList = wxProprietorLedgerMapper.selectList(queryWrapper);
if (selectList.isEmpty()) {
return R.ok();
}
return R.ok(selectList);
}
}
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxFamilyMemberBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxFamilyMemberVo;
import com.propertyManagement.business.service.IWxFamilyMemberService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.enums.BusinessType;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 家庭成员
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/familyMember")
public class ApiWxFamilyMemberController extends BaseController {
private final IWxFamilyMemberService iWxFamilyMemberService;
/**
* 根据户主查询家庭成员列表
*/
@GetMapping("/listAllByUserId")
public R<List<WxFamilyMemberVo>> listAllByUserId() {
LoginWxUser wxUser = AuthUtil.getWxUser();
WxFamilyMemberBo familyMemberBo = new WxFamilyMemberBo();
familyMemberBo.setProprietorId(wxUser.getProprietorId());
List<WxFamilyMemberVo> memberVoList = iWxFamilyMemberService.queryList(familyMemberBo);
return R.ok(memberVoList);
}
/**
* 新增家庭成员
*/
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxFamilyMemberBo bo) {
return toAjax(iWxFamilyMemberService.insertByBo(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxGuestBo;
import com.propertyManagement.business.domain.vo.WxGuestVo;
import com.propertyManagement.business.service.IWxGuestService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 访客
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/guest")
public class ApiWxGuestController extends BaseController {
private final IWxGuestService iWxGuestService;
/**
* 新增访客
*/
@RepeatSubmit()
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxGuestBo bo) {
return toAjax(iWxGuestService.add(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import com.propertyManagement.business.domain.bo.WxLiveBillBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxLiveBillVo;
import com.propertyManagement.business.service.IWxLiveBillService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.enums.LiveBillState;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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 javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 缴费账单
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/liveBill")
public class ApiWxLiveBillController extends BaseController {
private final IWxLiveBillService iWxLiveBillService;
/**
* 查询待缴账单列表
*/
@GetMapping("/listAll")
public R<List<WxLiveBillVo>> listAll(@NotEmpty(message = "类型不能为空") Integer type) {
LoginWxUser wxUser = AuthUtil.getWxUser();
WxLiveBillBo wxLiveBillBo = new WxLiveBillBo();
wxLiveBillBo.setProprietorId(wxUser.getProprietorId());
wxLiveBillBo.setType(type);
wxLiveBillBo.setState(LiveBillState.NO.getCode());
return R.ok(iWxLiveBillService.queryList(wxLiveBillBo));
}
/**
* 创建缴费账单
*/
@PostMapping("/add")
public R<Void> add(WxLiveBillBo bo) {
return toAjax(iWxLiveBillService.add(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import com.propertyManagement.business.domain.bo.WxPayRecordBo;
import com.propertyManagement.business.domain.vo.WxPayRecordVo;
import com.propertyManagement.business.service.IWxPayRecordService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.enums.PayState;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 缴费记录
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/payRecord")
public class ApiWxPayRecordController extends BaseController {
private final IWxPayRecordService iWxPayRecordService;
/**
* 查询缴费记录列表
*/
@GetMapping("/listAll")
public R<List<WxPayRecordVo>> listAll() {
WxPayRecordBo recordBo = new WxPayRecordBo();
recordBo.setProprietorId(AuthUtil.getWxUser().getProprietorId());
recordBo.setPayState(PayState.NO.getCode());
return R.ok(iWxPayRecordService.queryList(recordBo));
}
/**
* 新增缴费记录
*/
@RepeatSubmit()
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxPayRecordBo bo) {
return toAjax(iWxPayRecordService.insertByBo(bo));
}
}
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxProtocolBo;
import com.propertyManagement.business.domain.vo.WxProtocolVo;
import com.propertyManagement.business.service.IWxProtocolService;
import com.propertyManagement.common.annotation.Anonymous;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 用户协议
*
* @author liushuai
* @date 2025-05-24
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/protocol")
public class ApiWxProtocolController extends BaseController {
private final IWxProtocolService iWxProtocolService;
/**
* 获取用户协议详细信息
*
* @param type 主键
*/
@Anonymous
@GetMapping("/{type}")
public R<WxProtocolVo> getInfo(@NotNull(message = "类型不能为空")
@PathVariable Integer type) {
WxProtocolBo protocolBo = new WxProtocolBo();
protocolBo.setType(type);
protocolBo.setIsEnable(IsEnableType.YES.getCode());
List<WxProtocolVo> protocolVoList = iWxProtocolService.queryList(protocolBo);
if (protocolVoList.isEmpty()) {
return R.ok();
}
return R.ok(protocolVoList.get(0));
}
}
package com.propertyManagement.web.controller.business.api;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.business.domain.bo.WxRepairsBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxRepairsVo;
import com.propertyManagement.business.service.IWxRepairsService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.enums.RepairsState;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 报修
*
* @author liushuai
* @date 2025-05-14
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/repairs")
public class ApiWxRepairsController extends BaseController {
private final IWxRepairsService iWxRepairsService;
/**
* 查询用户报修列表
*/
@GetMapping("/userListAll")
public R<List<WxRepairsVo>> userListAll(WxRepairsBo bo) {
LoginWxUser wxUser = AuthUtil.getWxUser();
bo.setCommunityId(wxUser.getCommunityId());
bo.setUserId(wxUser.getId());
return R.ok(iWxRepairsService.queryList(bo));
}
/**
* 查询维修报修列表
*/
@GetMapping("/maintainListAll")
public R<List<WxRepairsVo>> maintainListAll(WxRepairsBo bo) {
LoginWxUser wxUser = AuthUtil.getWxUser();
bo.setCommunityId(wxUser.getCommunityId());
bo.setAccountId(wxUser.getAccountId());
return R.ok(iWxRepairsService.queryList(bo));
}
/**
* 获取报修单详细信息
*
* @param repairsId 主键
*/
@GetMapping("/{repairsId}")
public R<WxRepairsVo> getInfo(@NotNull(message = "报修单ID不能为空")
@PathVariable Long repairsId) {
return R.ok(iWxRepairsService.queryById(repairsId));
}
/**
* 新增报修
*/
@RepeatSubmit()
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody WxRepairsBo bo) {
return toAjax(iWxRepairsService.add(bo));
}
/**
* 取消报修
*
* @param repairsId 主键
*/
@PutMapping("/cancel/{repairsId}")
public R<Void> cancel(@NotNull(message = "主键不能为空")
@PathVariable Long repairsId) {
WxRepairsVo repairsVo = iWxRepairsService.queryById(repairsId);
if (null == repairsVo) {
return R.fail("报修单不存在,请刷新后重试!");
}
if (!repairsVo.getState().equals(RepairsState.ONE.getCode())) {
return R.fail("操作失败,报修单状态错误!");
}
WxRepairsBo repairsBo = BeanUtil.toBean(repairsVo, WxRepairsBo.class);
repairsBo.setState(RepairsState.FOUR.getCode());
repairsBo.setCloseTime(new Date());
return toAjax(iWxRepairsService.updateByBo(repairsBo));
}
/**
* 设置维修费用
*
* @param repairsId 主键
*/
@PutMapping("/setMoney/{repairsId}/{money}")
public R<Void> setMoney(@NotNull(message = "主键不能为空")
@PathVariable Long repairsId,
@NotNull(message = "金额不能为空")
@PathVariable BigDecimal money) {
WxRepairsVo repairsVo = iWxRepairsService.queryById(repairsId);
if (null == repairsVo) {
return R.fail("报修单不存在,请刷新后重试!");
}
if (!repairsVo.getState().equals(RepairsState.ONE.getCode())) {
return R.fail("操作失败,报修单状态错误!");
}
WxRepairsBo repairsBo = BeanUtil.toBean(repairsVo, WxRepairsBo.class);
repairsBo.setState(RepairsState.TWO.getCode());
return toAjax(iWxRepairsService.updateByBo(repairsBo));
}
/**
* 支付报修单
*
* @param repairsId 主键
*/
@PutMapping("/pay/{repairsId}")
public R<Void> pay(@NotEmpty(message = "主键不能为空") @PathVariable Long repairsId) {
return toAjax(true);
}
}
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.propertyManagement.business.domain.WxRule;
import com.propertyManagement.business.domain.bo.WxRuleBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.domain.vo.WxRuleVo;
import com.propertyManagement.business.mapper.WxRuleMapper;
import com.propertyManagement.business.service.IWxRuleService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 规则说明
*
* @author liushuai
* @date 2025-05-22
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/rule")
public class ApiWxRuleController extends BaseController {
private final IWxRuleService iWxRuleService;
private final WxRuleMapper wxRuleMapper;
/**
* 获取规则说明详细信息
*
* @param type 规则类型(1报修规则 2服务规则)
*/
@GetMapping("/{type}")
public R<WxRuleVo> getInfo(@PathVariable Integer type) {
LoginWxUser wxUser = AuthUtil.getWxUser();
if (wxUser.getCommunityId() == null) {
return R.fail("查询失败,未选择小区");
}
LambdaQueryWrapper<WxRule> ruleLambdaQueryWrapper = Wrappers.lambdaQuery();
ruleLambdaQueryWrapper.eq(WxRule::getCommunityId, wxUser.getCommunityId());
ruleLambdaQueryWrapper.eq(WxRule::getRuleType, type);
ruleLambdaQueryWrapper.eq(WxRule::getIsEnable, IsEnableType.YES.getCode());
ruleLambdaQueryWrapper.orderByDesc(WxRule::getUpdateTime);
List<WxRuleVo> ruleList = wxRuleMapper.selectVoList(ruleLambdaQueryWrapper);
if (ruleList.isEmpty()) {
return R.ok();
}
return R.ok(ruleList.get(0));
}
}
package com.propertyManagement.web.controller.common;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.captcha.AbstractCaptcha;
import cn.hutool.captcha.generator.CodeGenerator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.propertyManagement.common.constant.CacheConstants;
import com.propertyManagement.common.constant.Constants;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.enums.CaptchaType;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.utils.email.MailUtils;
import com.propertyManagement.common.utils.redis.RedisUtils;
import com.propertyManagement.common.utils.reflect.ReflectUtils;
import com.propertyManagement.common.utils.spring.SpringUtils;
import com.propertyManagement.framework.config.properties.CaptchaProperties;
import com.propertyManagement.framework.config.properties.MailProperties;
import com.propertyManagement.system.service.ISysConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.sms4j.api.SmsBlend;
import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.dromara.sms4j.provider.enumerate.SupplierType;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotBlank;
import java.time.Duration;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 验证码操作处理
*
* @author Lion Li
*/
@SaIgnore
@Slf4j
@Validated
@RequiredArgsConstructor
@RestController
public class CaptchaController {
private final CaptchaProperties captchaProperties;
private final ISysConfigService configService;
private final MailProperties mailProperties;
/**
* 短信验证码
*
* @param phonenumber 用户手机号
*/
@GetMapping("/captchaSms")
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
String code = RandomUtil.randomNumbers(4);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
// 验证码模板id 自行处理 (查数据库或写死均可)
String templateId = "";
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
map.put("code", code);
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
if (!"OK".equals(smsResponse.getCode())) {
log.error("验证码短信发送异常 => {}", smsResponse);
return R.fail(smsResponse.getMessage());
}
return R.ok();
}
/**
* 邮箱验证码
*
* @param email 邮箱
*/
@GetMapping("/captchaEmail")
public R<Void> emailCode(@NotBlank(message = "{user.email.not.blank}") String email) {
if (!mailProperties.getEnabled()) {
return R.fail("当前系统没有开启邮箱功能!");
}
String key = CacheConstants.CAPTCHA_CODE_KEY + email;
String code = RandomUtil.randomNumbers(4);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
try {
MailUtils.sendText(email, "登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。");
} catch (Exception e) {
log.error("验证码短信发送异常 => {}", e.getMessage());
return R.fail(e.getMessage());
}
return R.ok();
}
/**
* 生成验证码
*/
@GetMapping("/captchaImage")
public R<Map<String, Object>> getCode() {
Map<String, Object> ajax = new HashMap<>();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled) {
return R.ok(ajax);
}
// 保存验证码信息
String uuid = IdUtil.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
// 生成验证码
CaptchaType captchaType = captchaProperties.getType();
boolean isMath = CaptchaType.MATH == captchaType;
Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength();
CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length);
AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz());
captcha.setGenerator(codeGenerator);
captcha.createCode();
String code = captcha.getCode();
if (isMath) {
ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression(StringUtils.remove(code, "="));
code = exp.getValue(String.class);
}
RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
ajax.put("uuid", uuid);
ajax.put("img", captcha.getImageBase64());
return R.ok(ajax);
}
}
package com.propertyManagement.web.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollUtil;
import com.propertyManagement.common.constant.CacheConstants;
import com.propertyManagement.common.constant.CacheNames;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.utils.JsonUtils;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.utils.redis.CacheUtils;
import com.propertyManagement.common.utils.redis.RedisUtils;
import com.propertyManagement.system.domain.SysCache;
import lombok.RequiredArgsConstructor;
import org.redisson.spring.data.connection.RedissonConnectionFactory;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
/**
* 缓存监控
*
* @author Lion Li
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/cache")
public class CacheController {
private final RedissonConnectionFactory connectionFactory;
private final static List<SysCache> CACHES = new ArrayList<>();
static {
CACHES.add(new SysCache(CacheConstants.ONLINE_TOKEN_KEY, "在线用户"));
CACHES.add(new SysCache(CacheNames.SYS_CONFIG, "配置信息"));
CACHES.add(new SysCache(CacheNames.SYS_DICT, "数据字典"));
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(CacheNames.SYS_OSS_CONFIG, "OSS配置"));
CACHES.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
/**
* 获取缓存监控列表
*/
@SaCheckPermission("monitor:cache:list")
@GetMapping()
public R<Map<String, Object>> getInfo() throws Exception {
RedisConnection connection = connectionFactory.getConnection();
Properties info = connection.info();
Properties commandStats = connection.info("commandstats");
Long dbSize = connection.dbSize();
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
if (commandStats != null) {
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 R.ok(result);
}
/**
* 获取缓存监控缓存名列表
*/
@SaCheckPermission("monitor:cache:list")
@GetMapping("/getNames")
public R<List<SysCache>> cache() {
return R.ok(CACHES);
}
/**
* 获取缓存监控Key列表
*
* @param cacheName 缓存名
*/
@SaCheckPermission("monitor:cache:list")
@GetMapping("/getKeys/{cacheName}")
public R<Collection<String>> getCacheKeys(@PathVariable String cacheName) {
Collection<String> cacheKeys = new HashSet<>(0);
if (isCacheNames(cacheName)) {
Set<Object> keys = CacheUtils.keys(cacheName);
if (CollUtil.isNotEmpty(keys)) {
cacheKeys = keys.stream().map(Object::toString).collect(Collectors.toList());
}
} else {
cacheKeys = RedisUtils.keys(cacheName + "*");
}
return R.ok(cacheKeys);
}
/**
* 获取缓存监控缓存值详情
*
* @param cacheName 缓存名
* @param cacheKey 缓存key
*/
@SaCheckPermission("monitor:cache:list")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public R<SysCache> getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) {
Object cacheValue;
if (isCacheNames(cacheName)) {
cacheValue = CacheUtils.get(cacheName, cacheKey);
} else {
cacheValue = RedisUtils.getCacheObject(cacheKey);
}
SysCache sysCache = new SysCache(cacheName, cacheKey, JsonUtils.toJsonString(cacheValue));
return R.ok(sysCache);
}
/**
* 清理缓存监控缓存名
*
* @param cacheName 缓存名
*/
@SaCheckPermission("monitor:cache:list")
@DeleteMapping("/clearCacheName/{cacheName}")
public R<Void> clearCacheName(@PathVariable String cacheName) {
if (isCacheNames(cacheName)) {
CacheUtils.clear(cacheName);
} else {
RedisUtils.deleteKeys(cacheName + "*");
}
return R.ok();
}
/**
* 清理缓存监控Key
*
* @param cacheKey key名
*/
@SaCheckPermission("monitor:cache:list")
@DeleteMapping("/clearCacheKey/{cacheName}/{cacheKey}")
public R<Void> clearCacheKey(@PathVariable String cacheName, @PathVariable String cacheKey) {
if (isCacheNames(cacheName)) {
CacheUtils.evict(cacheName, cacheKey);
} else {
RedisUtils.deleteObject(cacheKey);
}
return R.ok();
}
/**
* 清理全部缓存监控
*/
@SaCheckPermission("monitor:cache:list")
@DeleteMapping("/clearCacheAll")
public R<Void> clearCacheAll() {
RedisUtils.deleteKeys("*");
return R.ok();
}
private boolean isCacheNames(String cacheName) {
return !StringUtils.contains(cacheName, ":");
}
}
package com.propertyManagement.web.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.constant.CacheConstants;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.common.utils.redis.RedisUtils;
import com.propertyManagement.system.domain.SysLogininfor;
import com.propertyManagement.system.service.ISysLogininforService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 系统访问记录
*
* @author Lion Li
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController {
private final ISysLogininforService logininforService;
/**
* 获取系统访问记录列表
*/
@SaCheckPermission("monitor:logininfor:list")
@GetMapping("/list")
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor, PageQuery pageQuery) {
return logininforService.selectPageLogininforList(logininfor, pageQuery);
}
/**
* 导出系统访问记录列表
*/
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@SaCheckPermission("monitor:logininfor:export")
@PostMapping("/export")
public void export(SysLogininfor logininfor, HttpServletResponse response) {
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
}
/**
* 批量删除登录日志
* @param infoIds 日志ids
*/
@SaCheckPermission("monitor:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public R<Void> remove(@PathVariable Long[] infoIds) {
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}
/**
* 清理系统访问记录
*/
@SaCheckPermission("monitor:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public R<Void> clean() {
logininforService.cleanLogininfor();
return R.ok();
}
@SaCheckPermission("monitor:logininfor:unlock")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public R<Void> unlock(@PathVariable("userName") String userName) {
String loginName = CacheConstants.PWD_ERR_CNT_KEY + userName;
if (RedisUtils.hasKey(loginName)) {
RedisUtils.deleteObject(loginName);
}
return R.ok();
}
}
package com.propertyManagement.web.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.system.domain.SysOperLog;
import com.propertyManagement.system.service.ISysOperLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 操作日志记录
*
* @author Lion Li
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController {
private final ISysOperLogService operLogService;
/**
* 获取操作日志记录列表
*/
@SaCheckPermission("monitor:operlog:list")
@GetMapping("/list")
public TableDataInfo<SysOperLog> list(SysOperLog operLog, PageQuery pageQuery) {
return operLogService.selectPageOperLogList(operLog, pageQuery);
}
/**
* 导出操作日志记录列表
*/
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@SaCheckPermission("monitor:operlog:export")
@PostMapping("/export")
public void export(SysOperLog operLog, HttpServletResponse response) {
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
}
/**
* 批量删除操作日志记录
* @param operIds 日志ids
*/
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@SaCheckPermission("monitor:operlog:remove")
@DeleteMapping("/{operIds}")
public R<Void> remove(@PathVariable Long[] operIds) {
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
/**
* 清理操作日志记录
*/
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@SaCheckPermission("monitor:operlog:remove")
@DeleteMapping("/clean")
public R<Void> clean() {
operLogService.cleanOperLog();
return R.ok();
}
}
package com.propertyManagement.web.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.constant.CacheConstants;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.domain.dto.UserOnlineDTO;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.utils.StreamUtils;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.utils.redis.RedisUtils;
import com.propertyManagement.system.domain.SysUserOnline;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 在线用户监控
*
* @author Lion Li
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController {
/**
* 获取在线用户监控列表
*
* @param ipaddr IP地址
* @param userName 用户名
*/
@SaCheckPermission("monitor:online:list")
@GetMapping("/list")
public TableDataInfo<SysUserOnline> list(String ipaddr, String userName) {
// 获取所有未过期的 token
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
List<UserOnlineDTO> userOnlineDTOList = new ArrayList<>();
for (String key : keys) {
String token = StringUtils.substringAfterLast(key, ":");
// 如果已经过期则跳过
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
continue;
}
userOnlineDTOList.add(RedisUtils.getCacheObject(CacheConstants.ONLINE_TOKEN_KEY + token));
}
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
StringUtils.equals(ipaddr, userOnline.getIpaddr()) &&
StringUtils.equals(userName, userOnline.getUserName())
);
} else if (StringUtils.isNotEmpty(ipaddr)) {
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
StringUtils.equals(ipaddr, userOnline.getIpaddr())
);
} else if (StringUtils.isNotEmpty(userName)) {
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
StringUtils.equals(userName, userOnline.getUserName())
);
}
Collections.reverse(userOnlineDTOList);
userOnlineDTOList.removeAll(Collections.singleton(null));
List<SysUserOnline> userOnlineList = BeanUtil.copyToList(userOnlineDTOList, SysUserOnline.class);
return TableDataInfo.build(userOnlineList);
}
/**
* 强退用户
*
* @param tokenId token值
*/
@SaCheckPermission("monitor:online:forceLogout")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public R<Void> forceLogout(@PathVariable String tokenId) {
try {
StpUtil.kickoutByTokenValue(tokenId);
} catch (NotLoginException ignored) {
}
return R.ok();
}
}
package com.propertyManagement.web.controller.pay;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.pay.domain.bo.CmsPayAppBo;
import com.propertyManagement.pay.domain.vo.CmsPayAppVo;
import com.propertyManagement.pay.service.IPayAppService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 支付应用
*
* @author liushuai
* @date 2025-05-12
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/pay/payApp")
public class PayAppController extends BaseController {
private final IPayAppService iPayAppService;
/**
* 查询支付应用列表
*/
@SaCheckPermission("pay:payApp:list")
@GetMapping("/list")
public TableDataInfo<CmsPayAppVo> list(CmsPayAppBo bo, PageQuery pageQuery) {
return iPayAppService.queryPageList(bo, pageQuery);
}
/**
* 导出支付应用列表
*/
@SaCheckPermission("pay:payApp:export")
@Log(title = "支付应用", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(CmsPayAppBo bo, HttpServletResponse response) {
List<CmsPayAppVo> list = iPayAppService.queryList(bo);
ExcelUtil.exportExcel(list, "支付应用", CmsPayAppVo.class, response);
}
/**
* 获取支付应用详细信息
*
* @param id 主键
*/
@SaCheckPermission("pay:payApp:query")
@GetMapping("/{id}")
public R<CmsPayAppVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iPayAppService.queryById(id));
}
/**
* 新增支付应用
*/
@SaCheckPermission("pay:payApp:add")
@Log(title = "支付应用", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmsPayAppBo bo) {
return toAjax(iPayAppService.insertByBo(bo));
}
/**
* 修改支付应用
*/
@SaCheckPermission("pay:payApp:edit")
@Log(title = "支付应用", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmsPayAppBo bo) {
return toAjax(iPayAppService.updateByBo(bo));
}
/**
* 删除支付应用
*
* @param ids 主键串
*/
@SaCheckPermission("pay:payApp:remove")
@Log(title = "支付应用", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iPayAppService.deleteWithValidByIds(Arrays.asList(ids), true));
}
/**
* 锁定应用配置
*
* @param id 应用ID
* @return 结果
*/
@SaCheckPermission("pay:payApp:lock")
@Log(title = "短信渠道锁定", businessType = BusinessType.UPDATE)
@PostMapping("lock/{id}")
public R<Void> lock(@NotNull(message = "应用ID不能为空") @PathVariable Long id) {
CmsPayAppVo payAppVo = iPayAppService.queryById(id);
if (null == payAppVo) {
return R.fail("应用不存在");
}
payAppVo.setIsLock(IsEnableType.YES.getCode());
CmsPayAppBo bo = BeanUtil.toBean(payAppVo, CmsPayAppBo.class);
return toAjax(iPayAppService.updateByBo(bo) ? 1 : 0);
}
}
package com.propertyManagement.web.controller.pay;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.pay.domain.bo.CmsPayBizBo;
import com.propertyManagement.pay.domain.vo.CmsPayBizVo;
import com.propertyManagement.pay.service.IPayBizService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 支付业务
*
* @author liushuai
* @date 2025-05-12
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/pay/payBiz")
public class PayBizController extends BaseController {
private final IPayBizService iPayBizService;
/**
* 查询支付业务列表
*/
@SaCheckPermission("pay:payBiz:list")
@GetMapping("/list")
public TableDataInfo<CmsPayBizVo> list(CmsPayBizBo bo, PageQuery pageQuery) {
return iPayBizService.queryPageList(bo, pageQuery);
}
/**
* 导出支付业务列表
*/
@SaCheckPermission("pay:payBiz:export")
@Log(title = "支付业务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(CmsPayBizBo bo, HttpServletResponse response) {
List<CmsPayBizVo> list = iPayBizService.queryList(bo);
ExcelUtil.exportExcel(list, "支付业务", CmsPayBizVo.class, response);
}
/**
* 获取支付业务详细信息
*
* @param id 主键
*/
@SaCheckPermission("pay:payBiz:query")
@GetMapping("/{id}")
public R<CmsPayBizVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iPayBizService.queryById(id));
}
/**
* 新增支付业务
*/
@SaCheckPermission("pay:payBiz:add")
@Log(title = "支付业务", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmsPayBizBo bo) {
return toAjax(iPayBizService.insertByBo(bo));
}
/**
* 修改支付业务
*/
@SaCheckPermission("pay:payBiz:edit")
@Log(title = "支付业务", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmsPayBizBo bo) {
return toAjax(iPayBizService.updateByBo(bo));
}
/**
* 删除支付业务
*
* @param ids 主键串
*/
@SaCheckPermission("pay:payBiz:remove")
@Log(title = "支付业务", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iPayBizService.deleteWithValidByIds(Arrays.asList(ids), true));
}
/**
* 锁定支付业务
*
* @param id 支付业务ID
* @return 结果
*/
@SaCheckPermission("pay:payBiz:lock")
@Log(title = "锁定支付业务", businessType = BusinessType.UPDATE)
@PostMapping("lock/{id}")
public R<Void> lock(@NotNull(message = "支付业务ID不能为空") @PathVariable Long id) {
CmsPayBizVo payBizVo = iPayBizService.queryById(id);
if (null == payBizVo) {
return R.fail("支付业务不存在");
}
payBizVo.setIsLock(IsEnableType.YES.getCode());
CmsPayBizBo bo = BeanUtil.toBean(payBizVo, CmsPayBizBo.class);
return toAjax(iPayBizService.updateByBo(bo) ? 1 : 0);
}
}
package com.propertyManagement.web.controller.pay;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.pay.domain.bo.CmsPayMerchantBo;
import com.propertyManagement.pay.domain.vo.CmsPayMerchantVo;
import com.propertyManagement.pay.service.IPayMerchantService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 支付商户
*
* @author liushuai
* @date 2025-05-12
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/pay/payMerchant")
public class PayMerchantController extends BaseController {
private final IPayMerchantService iPayMerchantService;
/**
* 查询支付商户列表
*/
@SaCheckPermission("pay:payMerchant:list")
@GetMapping("/list")
public TableDataInfo<CmsPayMerchantVo> list(CmsPayMerchantBo bo, PageQuery pageQuery) {
return iPayMerchantService.queryPageList(bo, pageQuery);
}
/**
* 导出支付商户列表
*/
@SaCheckPermission("pay:payMerchant:export")
@Log(title = "支付商户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(CmsPayMerchantBo bo, HttpServletResponse response) {
List<CmsPayMerchantVo> list = iPayMerchantService.queryList(bo);
ExcelUtil.exportExcel(list, "支付商户", CmsPayMerchantVo.class, response);
}
/**
* 获取支付商户详细信息
*
* @param id 主键
*/
@SaCheckPermission("pay:payMerchant:query")
@GetMapping("/{id}")
public R<CmsPayMerchantVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iPayMerchantService.queryById(id));
}
/**
* 获取支付商户详细信息
*
* @param code 商户编号
* @return 详细信息
*/
@SaCheckPermission("cms:pay-merchant:query")
@GetMapping(value = "/getByCode/{code}")
public R getInfoByCode(@PathVariable("code") String code) {
return R.ok(iPayMerchantService.getByCode(code));
}
/**
* 新增支付商户
*/
@SaCheckPermission("pay:payMerchant:add")
@Log(title = "支付商户", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmsPayMerchantBo bo) {
return toAjax(iPayMerchantService.insertByBo(bo));
}
/**
* 修改支付商户
*/
@SaCheckPermission("pay:payMerchant:edit")
@Log(title = "支付商户", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmsPayMerchantBo bo) {
return toAjax(iPayMerchantService.updateByBo(bo));
}
/**
* 删除支付商户
*
* @param ids 主键串
*/
@SaCheckPermission("pay:payMerchant:remove")
@Log(title = "支付商户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iPayMerchantService.deleteWithValidByIds(Arrays.asList(ids), true));
}
/**
* 锁定商户
*
* @param id 渠道ID
* @return 结果
*/
@SaCheckPermission("cms:payMerchant:lock")
@Log(title = "短信渠道锁定", businessType = BusinessType.UPDATE)
@PostMapping("lock/{id}")
public R<Void> lock(@NotNull(message = "渠道ID不能为空") @PathVariable Long id) {
CmsPayMerchantVo payMerchantVo = iPayMerchantService.queryById(id);
if (null == payMerchantVo) {
return R.fail("商户不存在");
}
payMerchantVo.setIsLock(IsEnableType.YES.getCode());
CmsPayMerchantBo bo = BeanUtil.toBean(payMerchantVo, CmsPayMerchantBo.class);
return toAjax(iPayMerchantService.updateByBo(bo) ? 1 : 0);
}
}
package com.propertyManagement.web.controller.pay;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import com.propertyManagement.pay.domain.bo.CmsPayProviderBo;
import com.propertyManagement.pay.domain.vo.CmsPayProviderVo;
import com.propertyManagement.pay.service.IPayProviderService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 支付服务商
*
* @author liushuai
* @date 2025-05-12
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/pay/payProvider")
public class PayProviderController extends BaseController {
private final IPayProviderService iPayProviderService;
/**
* 查询支付服务商列表
*/
@SaCheckPermission("pay:payProvider:list")
@GetMapping("/list")
public TableDataInfo<CmsPayProviderVo> list(CmsPayProviderBo bo, PageQuery pageQuery) {
return iPayProviderService.queryPageList(bo, pageQuery);
}
/**
* 查询全部可用短信服务商列表
*
* @return 列表
*/
@SaCheckPermission("cms:payProvider:list")
@GetMapping("/listAll")
public R<List<CmsPayProviderVo>> listAll() {
CmsPayProviderBo payProviderBo = new CmsPayProviderBo();
payProviderBo.setIsEnable(IsEnableType.YES.getCode());
payProviderBo.setIsLock(IsEnableType.YES.getCode());
List<CmsPayProviderVo> providerVoList = iPayProviderService.queryList(payProviderBo);
return R.ok(providerVoList);
}
/**
* 导出支付服务商列表
*/
@SaCheckPermission("pay:payProvider:export")
@Log(title = "支付服务商", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(CmsPayProviderBo bo, HttpServletResponse response) {
List<CmsPayProviderVo> list = iPayProviderService.queryList(bo);
ExcelUtil.exportExcel(list, "支付服务商", CmsPayProviderVo.class, response);
}
/**
* 获取支付服务商详细信息
*
* @param id 主键
*/
@SaCheckPermission("pay:payProvider:query")
@GetMapping("/{id}")
public R<CmsPayProviderVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(iPayProviderService.queryById(id));
}
/**
* 新增支付服务商
*/
@SaCheckPermission("pay:payProvider:add")
@Log(title = "支付服务商", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CmsPayProviderBo bo) {
return toAjax(iPayProviderService.insertByBo(bo));
}
/**
* 修改支付服务商
*/
@SaCheckPermission("pay:payProvider:edit")
@Log(title = "支付服务商", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CmsPayProviderBo bo) {
return toAjax(iPayProviderService.updateByBo(bo));
}
/**
* 删除支付服务商
*
* @param ids 主键串
*/
@SaCheckPermission("pay:payProvider:remove")
@Log(title = "支付服务商", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iPayProviderService.deleteWithValidByIds(Arrays.asList(ids), true));
}
/**
* 锁定服务商
*
* @param id 服务商ID
* @return 结果
*/
@SaCheckPermission("cms:payProvider:lock")
@Log(title = "短信渠道锁定", businessType = BusinessType.UPDATE)
@PostMapping("lock/{id}")
public R<Void> lock(@NotNull(message = "服务商ID不能为空") @PathVariable Long id) {
CmsPayProviderVo payProviderVo = iPayProviderService.queryById(id);
if (null == payProviderVo) {
return R.fail("服务商不存在");
}
payProviderVo.setIsLock(IsEnableType.YES.getCode());
CmsPayProviderBo bo = BeanUtil.toBean(payProviderVo, CmsPayProviderBo.class);
return toAjax(iPayProviderService.updateByBo(bo) ? 1 : 0);
}
}
package com.propertyManagement.web.controller.system;
import cn.dev33.satoken.annotation.SaIgnore;
import com.propertyManagement.common.config.PropertyManagementConfig;
import com.propertyManagement.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 首页
*
* @author Lion Li
*/
@RequiredArgsConstructor
@RestController
public class SysIndexController {
/**
* 系统基础配置
*/
private final PropertyManagementConfig propertymanagementConfig;
/**
* 访问首页,提示语
*/
@SaIgnore
@GetMapping("/")
public String index() {
return StringUtils.format("当前版本:v{}", propertymanagementConfig.getVersion());
}
}
package com.propertyManagement.web.controller.system;
import cn.dev33.satoken.annotation.SaIgnore;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.domain.model.RegisterBody;
import com.propertyManagement.system.service.ISysConfigService;
import com.propertyManagement.system.service.SysRegisterService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* 注册验证
*
* @author Lion Li
*/
@Validated
@RequiredArgsConstructor
@RestController
public class SysRegisterController extends BaseController {
private final SysRegisterService registerService;
private final ISysConfigService configService;
/**
* 用户注册
*/
@SaIgnore
@PostMapping("/register")
public R<Void> register(@Validated @RequestBody RegisterBody user) {
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
return R.fail("当前系统没有开启注册功能!");
}
registerService.register(user);
return R.ok();
}
}
This diff is collapsed.
Application Version: ${propertymanagement-vue-plus.version}
Spring Boot Version: ${spring-boot.version}
__________ _____.___.__ ____ ____ __________.__
\______ \__ __ ____\__ | |__| \ \ / /_ __ ____ \______ \ | __ __ ______
| _/ | \/ _ \/ | | | ______ \ Y / | \_/ __ \ ______ | ___/ | | | \/ ___/
| | \ | ( <_> )____ | | /_____/ \ /| | /\ ___/ /_____/ | | | |_| | /\___ \
|____|_ /____/ \____// ______|__| \___/ |____/ \___ > |____| |____/____//____ >
\/ \/ \/ \/
This diff is collapsed.
# p6spy 性能分析插件配置文件
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
# 自定义日志打印
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
#日志输出到控制台
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
# 使用日志系统记录 sql
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
# 设置 p6spy driver 代理
#deregisterdrivers=true
# 取消JDBC URL前缀
useprefix=true
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
excludecategories=info,debug,result,commit,resultset
# 日期格式
dateformat=yyyy-MM-dd HH:mm:ss
# SQL语句打印时间格式
databaseDialectTimestampFormat=yyyy-MM-dd HH:mm:ss
# 实际驱动可多个
#driverlist=org.h2.Driver
# 是否开启慢SQL记录
outagedetection=true
# 慢SQL记录标准 2 秒
outagedetectioninterval=2
# 是否过滤 Log
filter=true
# 过滤 Log 时所排除的 sql 关键字,以逗号分隔
exclude=SELECT 1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment