| | |
| | | *.class |
| | | ###################################################################### |
| | | # Build Tools |
| | | .DS_Store |
| | | .gradle |
| | | /build/ |
| | | !gradle/wrapper/gradle-wrapper.jar |
| | | |
| | | # Mobile Tools for Java (J2ME) |
| | | .mtj.tmp/ |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | |
| | | # Package Files # |
| | | *.jar |
| | | *.war |
| | | *.ear |
| | | ###################################################################### |
| | | # IDE |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### JRebel ### |
| | | rebel.xml |
| | | |
| | | ### NetBeans ### |
| | | nbproject/private/ |
| | | build/* |
| | | nbbuild/ |
| | | dist/ |
| | | nbdist/ |
| | | .nb-gradle/ |
| | | |
| | | ###################################################################### |
| | | # Others |
| | | *.log |
| | | *.xml.versionsBackup |
| | | *.swp |
| | | |
| | | !*/build/*.java |
| | | !*/build/*.html |
| | | !*/build/*.xml |
New file |
| | |
| | | ## 崇州自主安置管理 |
| | | |
| | | #### 代码规范 |
| | | 1. 代码规范遵循若依架构,controller层位于 cz-admin下 com.ruoyi.web.controller |
| | | 2. 新建模块 【cz-bussiness】 存放业务逻辑 |
| | | #### 项目启动说明及注意事项 |
| | | 1. 无特别注意事项 |
| | | #### 项目开发架构说明 |
| | | 1. spring boot + mybatis |
| | | #### 项目运行环境和版本、所有中间件名称和版本 |
| | | 1. redis |
| | | 2. mysql 8.0 |
| | | 3. jdk1.8 |
| | | #### 数据库全量备份SQL |
| | | 1. 存放位置在根目录【sql】文件夹下 |
| | | #### 项目配置文件(云配置需要导出配置文件) |
| | | 1. 无 |
| | | |
| | | #### 项目接口文档或访问接口文档访问地址: |
| | | 1. http://localhost:8888/api/swagger-ui/index.html |
New file |
| | |
| | | <?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>chongzhou</artifactId> |
| | | <groupId>com.cz</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <packaging>jar</packaging> |
| | | <artifactId>cz-admin</artifactId> |
| | | |
| | | <description> |
| | | web服务入口 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- <!– spring-boot-devtools –>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-devtools</artifactId>--> |
| | | <!-- <optional>true</optional> <!– 表示依赖不会传递 –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- swagger3--> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 --> |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | <!-- Mysql驱动包 --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 核心模块--> |
| | | <dependency> |
| | | <groupId>com.cz</groupId> |
| | | <artifactId>cz-framework</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.cz</groupId> |
| | | <artifactId>cz-bussiness</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <version>3.1.0</version> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * 启动程序 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @EnableScheduling |
| | | @EnableTransactionManagement |
| | | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
| | | public class ChongZhouApplication { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ChongZhouApplication.class, args); |
| | | System.out.println("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * web容器中进行部署 |
| | | */ |
| | | public class ChongZhouServletInitializer extends SpringBootServletInitializer { |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
| | | return application.sources(ChongZhouApplication.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.ruoyi.bussiness.domain.Compensate; |
| | | import com.ruoyi.bussiness.service.CompensateService; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/compensate") |
| | | @Api(value = "补偿标准控制器",tags = "补偿标准控制器") |
| | | public class CompensateController { |
| | | |
| | | @Autowired |
| | | private CompensateService compensateService; |
| | | |
| | | @ApiOperation(value = "补偿标准信息", notes = "补偿标准信息") |
| | | @PostMapping(value = "/list") |
| | | public BaseResult<List<Compensate>> list() { |
| | | List<Compensate> compensates = compensateService.list(); |
| | | return ResponseUtils.successResponse(compensates); |
| | | } |
| | | |
| | | @PostMapping(value = "/edit") |
| | | @ApiOperation(value = "补偿标准修改(批量修改)", notes = "补偿标准修改(批量修改)") |
| | | public BaseResult<Object> edit(@RequestBody List<Compensate> compensate) { |
| | | compensateService.updateCompensate(compensate); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileAddRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileDelRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileUpdateRequest; |
| | | import com.ruoyi.bussiness.service.DataFileService; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import com.ruoyi.bussiness.object.request.dataFile.ListRequest; |
| | | import com.ruoyi.bussiness.object.response.dataFile.ListResponse; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | |
| | | @Validated |
| | | @Api(value = "存储资料管理",tags = "存储资料管理") |
| | | @RestController |
| | | @RequestMapping(value = "/file") |
| | | public class DataFileController { |
| | | |
| | | @Autowired |
| | | private DataFileService dataFileService; |
| | | |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | @PostMapping(value = "/list") |
| | | public BaseResult<ListResponse> list(@RequestBody ListRequest request) { |
| | | ListResponse response = dataFileService.list(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | @PostMapping(value = "/add") |
| | | public BaseResult<Object> add(@Valid @RequestBody FileAddRequest request) { |
| | | dataFileService.add(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | @PostMapping(value = "/update") |
| | | public BaseResult<Object> update(@Valid @RequestBody FileUpdateRequest request) { |
| | | dataFileService.update(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除", notes = "删除") |
| | | @PostMapping(value = "/del") |
| | | public BaseResult<Object> del(@Valid @RequestBody FileDelRequest request) { |
| | | dataFileService.del(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.object.response.index.IndexMessageResponse; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Validated |
| | | @Api(value = "首页",tags = "首页") |
| | | @RestController |
| | | @RequestMapping(value = "/index") |
| | | public class IndexController { |
| | | |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | |
| | | @ApiOperation(value = "首页消息", notes = "首页消息") |
| | | @PostMapping(value = "/message") |
| | | public BaseResult<IndexMessageResponse> alwaysMessage() { |
| | | IndexMessageResponse response = new IndexMessageResponse(); |
| | | List<SysNotice> sysNotices = sysNoticeService.alwaysMessage(); |
| | | response.setAlwaysMessages(sysNotices); |
| | | List<SysNotice> payMessage = sysNoticeService.payMessage(); |
| | | response.setNoticeMessage(payMessage); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import com.ruoyi.bussiness.object.request.placementApply.*; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyPageResponse; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyRecordIdRequest; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyRecordPageResponse; |
| | | import com.ruoyi.bussiness.service.PlacementApplyService; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.MultiDropdownWriteHandler; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import com.ruoyi.bussiness.enums.TemplateFileTypeEnum; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Validated |
| | | @Api(value = "自主购房安置申请批次表",tags = "自主购房安置申请批次表") |
| | | @RestController |
| | | @RequestMapping(value = "/placement-apply") |
| | | public class PlacementApplyController { |
| | | |
| | | @Autowired |
| | | private PlacementApplyService placementApplyService; |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @ApiOperation(value = "自主购房安置申请批次表-列表", notes = "自主购房安置申请批次表-列表") |
| | | @PostMapping(value = "/page") |
| | | public BaseResult<PlacementApplyPageResponse> page(@RequestBody PlacementApplyPageRequest request) { |
| | | PlacementApplyPageResponse response = placementApplyService.page(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房安置申请批次表-详情", notes = "自主购房安置申请批次表-详情") |
| | | @PostMapping(value = "/detail") |
| | | public BaseResult<PlacementApplyRecordPageResponse> detail(@Valid @RequestBody PlacementApplyRecordPageRequest request) { |
| | | PlacementApplyRecordPageResponse response = placementApplyService.detail(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房安置申请批次表-删除", notes = "自主购房安置申请批次表-删除") |
| | | @PostMapping(value = "/del") |
| | | public BaseResult<Object> del(@RequestBody PlacementApplyIdRequest request) { |
| | | placementApplyService.del(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "数据审核", notes = "数据审核") |
| | | @PostMapping(value = "/data-approve") |
| | | public BaseResult<Object> dataApprove(@RequestBody PlacementApplyIdRequest request){ |
| | | placementApplyService.dataApprove(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "数据核对", notes = "数据核对") |
| | | @PostMapping(value = "/record-check") |
| | | public BaseResult<Object> recordCheck(@Valid @RequestBody PlacementApplyRecordIdRequest request){ |
| | | placementApplyService.recordCheck(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "自主购房安置申请批次表-审核", notes = "自主购房安置申请批次表-审核") |
| | | @PostMapping(value = "/approve") |
| | | public BaseResult<Object> approve(@Valid @RequestBody PlacementApplyApproveRequest request) { |
| | | placementApplyService.approve(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载自主购房申请批次表模版", notes = "下载自主购房申请批次表模版") |
| | | @PostMapping(value = "/download-template") |
| | | public void downloadTemplate(HttpServletResponse response) throws IOException { |
| | | try { |
| | | //街道 |
| | | List<SysDictData> street = dictTypeService.selectDictDataByType("street"); |
| | | TemplateFileTypeEnum pathByFileType = TemplateFileTypeEnum.getEnumByFileType(2); |
| | | Method generateExampleDataMethod = pathByFileType.getClazz().getMethod("generateExampleData"); |
| | | Method generateHeaderDataMethod = pathByFileType.getClazz().getMethod("generateHeaderData", List.class); |
| | | Object exampleData = generateExampleDataMethod.invoke(null); |
| | | Object headerData = generateHeaderDataMethod.invoke(null, street); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, pathByFileType.getFileName()); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), pathByFileType.getClazz()); |
| | | if (Objects.nonNull(headerData)) { |
| | | write.registerWriteHandler((MultiDropdownWriteHandler) headerData); |
| | | } |
| | | write.sheet("sheet") |
| | | .doWrite(Collections.singletonList(exampleData)); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出模版失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1.最外面的导入:没有申请表id的情况,需要汇总数据到申请汇总表,需要新建申请表 |
| | | * 2.详情里面的导入:有申请表id的情况,直接追加数据到现有的申请表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导入自主购房申请批次表", notes = "导入自主购房申请批次表") |
| | | @PostMapping(value = "/imports") |
| | | public BaseResult<Object> imports(PlacementImportsRequest request) throws IOException { |
| | | placementApplyService.imports(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-记录添加") |
| | | @PostMapping(value = "/record-add") |
| | | public BaseResult<Object> recordAdd(@RequestBody PlacementApplyRecord placementApplyRecord){ |
| | | placementApplyService.recordAdd(placementApplyRecord); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-记录编辑") |
| | | @PostMapping(value = "/record-detail") |
| | | public BaseResult<PlacementApplyRecord> recordDetail(@Valid @RequestBody PlacementApplyIdRequest placementApplyRecord) { |
| | | PlacementApplyRecord record = placementApplyService.recordDetail(placementApplyRecord); |
| | | return ResponseUtils.successResponse(record); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-记录删除") |
| | | @PostMapping(value = "/record-del") |
| | | public BaseResult<Object> recordDel(@RequestBody PlacementApplyRecordIdRequest request){ |
| | | placementApplyService.recordDel(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-记录编辑") |
| | | @PostMapping(value = "/record-edit") |
| | | public BaseResult<Object> recordEdit(@RequestBody PlacementApplyRecord placementApplyRecord){ |
| | | placementApplyService.recordEdit(placementApplyRecord); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-问题数据导出") |
| | | @PostMapping(value = "/problem-export") |
| | | public void problemExport(@RequestBody ApplyProblemExportRequest request, HttpServletResponse response) throws IOException { |
| | | placementApplyService.problemExport(request,response); |
| | | } |
| | | |
| | | @ApiOperation(value = "自主购房申请批次表-全部数据导出") |
| | | @PostMapping(value = "/exports") |
| | | public void exports(@RequestBody ApplyAllExportRequest request, HttpServletResponse response) throws IOException { |
| | | placementApplyService.allExport(request,response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.object.request.placementApply.PlacementApplyIdRequest; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.*; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementBatchDetailResponse; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementBatchPageResponse; |
| | | import com.ruoyi.bussiness.service.PlacementBatchService; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.MultiDropdownWriteHandler; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import com.ruoyi.bussiness.enums.TemplateFileTypeEnum; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Validated |
| | | @Api(value = "安置批次",tags = "安置批次") |
| | | @RestController |
| | | @RequestMapping(value = "/placement-batch") |
| | | public class PlacementBatchController { |
| | | |
| | | @Autowired |
| | | private PlacementBatchService placementBatchService; |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @ApiOperation(value = "安置批次-列表", notes = "安置批次-列表") |
| | | @PostMapping(value = "/page") |
| | | public BaseResult<PlacementBatchPageResponse> page(@RequestBody PlacementBatchPageRequest request) { |
| | | PlacementBatchPageResponse response = placementBatchService.page(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载安置批次模版(3资金表,4房产表)", notes = "下载安置批次模版(3资金表,4房产表)") |
| | | @PostMapping(value = "/download-template/{type}") |
| | | public void downloadTemplate(@PathVariable Integer type, HttpServletResponse response) throws IOException { |
| | | try { |
| | | //街道 |
| | | List<SysDictData> street = dictTypeService.selectDictDataByType("street"); |
| | | TemplateFileTypeEnum pathByFileType = TemplateFileTypeEnum.getEnumByFileType(type); |
| | | Method generateExampleDataMethod = pathByFileType.getClazz().getMethod("generateExampleData"); |
| | | Method generateHeaderDataMethod = pathByFileType.getClazz().getMethod("generateHeaderData", List.class); |
| | | Object exampleData = generateExampleDataMethod.invoke(null); |
| | | Object headerData = generateHeaderDataMethod.invoke(null, street); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, pathByFileType.getFileName()); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), pathByFileType.getClazz()); |
| | | if (Objects.nonNull(headerData)) { |
| | | write.registerWriteHandler((MultiDropdownWriteHandler) headerData); |
| | | } |
| | | write.sheet("sheet") |
| | | .doWrite(Collections.singletonList(exampleData)); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出模版失败"); |
| | | } |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "导入", notes = "导入") |
| | | @PostMapping(value = "/imports") |
| | | public BaseResult<Object> imports(PlacementBatchImportRequest request) { |
| | | placementBatchService.imports(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "安置批次-详情",notes="安置批次-详情") |
| | | @PostMapping(value = "/detail") |
| | | public BaseResult<PlacementBatchDetailResponse> detail(@Valid @RequestBody PlacementBatchDetailRequest request) { |
| | | PlacementBatchDetailResponse responses = placementBatchService.detail(request); |
| | | return ResponseUtils.successResponse(responses); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "数据审核", notes = "数据审核") |
| | | @PostMapping(value = "/data-approve") |
| | | public BaseResult<Object> dataApprove(@RequestBody PlacementBatchIdRequest request){ |
| | | placementBatchService.dataApprove(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "资金数据核对", notes = "资金数据核对") |
| | | @PostMapping(value = "/asset-check") |
| | | public BaseResult<Object> assetCheck(@Valid @RequestBody IdRequest request){ |
| | | placementBatchService.assetCheck(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "购房数据核对", notes = "资金数据核对") |
| | | @PostMapping(value = "/household-check") |
| | | public BaseResult<Object> householdCheck(@Valid @RequestBody IdRequest request){ |
| | | placementBatchService.householdCheck(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "安置批次-删除",notes = "安置批次-删除") |
| | | @PostMapping(value = "/del") |
| | | public BaseResult<Object> del(@Valid @RequestBody PlacementBatchIdRequest request){ |
| | | placementBatchService.del(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-资金记录编辑",notes="安置批次-资金记录编辑") |
| | | @PostMapping(value = "/asset-edit") |
| | | public BaseResult<Object> assetEdit(@RequestBody PlacementBatchAsset request){ |
| | | placementBatchService.assetEdit(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-购房记录编辑",notes="安置批次-购房记录编辑") |
| | | @PostMapping(value = "/household-edit") |
| | | public BaseResult<Object> householdEdit(@RequestBody PlacementBatchHousehold request){ |
| | | placementBatchService.householdEdit(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-资金记录删除",notes="安置批次-资金记录删除") |
| | | @PostMapping(value = "/asset-del") |
| | | public BaseResult<Object> assetDel(@RequestBody IdRequest request){ |
| | | placementBatchService.assetDel(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-购房记录删除",notes="安置批次-购房记录删除") |
| | | @PostMapping(value = "/household-del") |
| | | public BaseResult<Object> householdDel(@RequestBody IdRequest request){ |
| | | placementBatchService.householdDel(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-资金记录添加",notes="安置批次-资金记录添加") |
| | | @PostMapping(value = "/asset-add") |
| | | public BaseResult<Object> assetAdd(@RequestBody PlacementBatchAsset request){ |
| | | placementBatchService.assetAdd(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-购房记录添加",notes="安置批次-购房记录添加") |
| | | @PostMapping(value = "/household-add") |
| | | public BaseResult<Object> householdAdd(@RequestBody PlacementBatchHousehold request){ |
| | | placementBatchService.householdAdd(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "安置批次-资金记录详情",notes="安置批次-资金记录详情") |
| | | @PostMapping(value = "/asset-detail") |
| | | public BaseResult<PlacementBatchAsset> assetDetail(@RequestBody IdRequest request){ |
| | | PlacementBatchAsset response = placementBatchService.assetDetail(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "安置批次-购房记录详情",notes="安置批次-购房记录详情") |
| | | @PostMapping(value = "/household-detail") |
| | | public BaseResult<PlacementBatchHousehold> householdDetail(@RequestBody IdRequest request){ |
| | | PlacementBatchHousehold response = placementBatchService.householdDetail(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "安置批次-审核",notes="安置批次-审核") |
| | | @PostMapping(value = "/approve") |
| | | public BaseResult<Object> approve(@RequestBody ApproveRequest request){ |
| | | placementBatchService.approve(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "安置批次-问题数据导出") |
| | | @PostMapping(value = "/problem-export") |
| | | public void problemExport(@RequestBody ProblemExportRequest request, HttpServletResponse response) throws IOException { |
| | | placementBatchService.problemExport(request,response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementIdRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementImportRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementPageRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.GetHouseHistoryRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.PlacementPageResponse; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import com.ruoyi.bussiness.service.PlacementService; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.MultiDropdownWriteHandler; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import com.ruoyi.bussiness.enums.TemplateFileTypeEnum; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Validated |
| | | @Api(value = "待安置人员库",tags = "待安置人员库") |
| | | @RestController |
| | | @RequestMapping(value = "/placement") |
| | | public class PlacementController { |
| | | |
| | | @Autowired |
| | | private PlacementService placementService; |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | @PostMapping(value = "/page") |
| | | public BaseResult<PlacementPageResponse> page(@RequestBody PlacementPageRequest request) { |
| | | PlacementPageResponse response = placementService.page(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询安置购房信息", notes = "查询安置购房信息") |
| | | @PostMapping(value = "/get-house-history") |
| | | public BaseResult<List<PlacementBatchHousehold>> getHouseHistory(@RequestBody GetHouseHistoryRequest request){ |
| | | // List<PlacementBatchHousehold> households = placementBatchHouseholdService.getHouseHistory(request); |
| | | // return ResponseUtils.successResponse(households); |
| | | return ResponseUtils.successResponse(null); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "新增", notes = "新增") |
| | | @PostMapping(value = "/add") |
| | | public BaseResult<Object> add(@RequestBody Placement placement) { |
| | | placementService.add(placement); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑", notes = "编辑") |
| | | @PostMapping(value = "/edit") |
| | | public BaseResult<Object> edit(@RequestBody Placement placement) { |
| | | placementService.update(placement); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | @PostMapping(value = "/detail") |
| | | public BaseResult<Placement> detail(@RequestBody PlacementIdRequest request) { |
| | | Placement placement = placementService.detail(request); |
| | | return ResponseUtils.successResponse(placement); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除", notes = "删除") |
| | | @PostMapping(value = "/del") |
| | | public BaseResult<Object> del(@RequestBody PlacementIdRequest request) { |
| | | placementService.del(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载模版", notes = "下载模版") |
| | | @PostMapping(value = "/download-template") |
| | | public void downloadTemplate(HttpServletResponse response) throws IOException { |
| | | try { |
| | | //街道 |
| | | List<SysDictData> street = dictTypeService.selectDictDataByType("street"); |
| | | List<SysDictData> relation = dictTypeService.selectDictDataByType("relation"); |
| | | TemplateFileTypeEnum pathByFileType = TemplateFileTypeEnum.getEnumByFileType(1); |
| | | Method generateExampleDataMethod = pathByFileType.getClazz().getMethod("generateExampleData"); |
| | | Method generateHeaderDataMethod = pathByFileType.getClazz().getMethod("generateHeaderData",List.class,List.class); |
| | | Object exampleData = generateExampleDataMethod.invoke(null); |
| | | Object headerData = generateHeaderDataMethod.invoke(null,street,relation); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, pathByFileType.getFileName()); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), pathByFileType.getClazz()); |
| | | if (Objects.nonNull(headerData)) { |
| | | write.registerWriteHandler((MultiDropdownWriteHandler) headerData); |
| | | } |
| | | write.sheet("sheet") |
| | | .doWrite(Collections.singletonList(exampleData)); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出模版失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "导入", notes = "导入") |
| | | @PostMapping(value = "/imports") |
| | | public BaseResult<Object> imports(PlacementImportRequest request) { |
| | | placementService.imports(request); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.ruoyi.bussiness.object.request.error.ErrorPageRequest; |
| | | import com.ruoyi.bussiness.object.response.error.ErrorPageResponse; |
| | | import com.ruoyi.bussiness.service.PlacementErrorService; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @Validated |
| | | @Api(value = "错误统计",tags = "错误统计") |
| | | @RestController |
| | | @RequestMapping(value = "/placement-error") |
| | | public class PlacementErrorController { |
| | | |
| | | @Autowired |
| | | private PlacementErrorService placementErrorService; |
| | | |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | @PostMapping(value = "/page") |
| | | public BaseResult<ErrorPageResponse> page(@Valid @RequestBody ErrorPageRequest request) { |
| | | ErrorPageResponse response = placementErrorService.page(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.response.report.DetailPageResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportPageResponse; |
| | | import com.ruoyi.bussiness.service.ReportService; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | |
| | | @Validated |
| | | @Api(value = "各季度应付款明细列表",tags = "各季度应付款明细列表") |
| | | @RestController |
| | | @RequestMapping(value = "/report") |
| | | public class ReportController { |
| | | |
| | | @Autowired |
| | | private ReportService reportService; |
| | | |
| | | |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | @PostMapping(value = "/page") |
| | | public BaseResult<ReportPageResponse> page(@RequestBody ReportPageRequest request){ |
| | | ReportPageResponse response = reportService.page(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | @PostMapping(value = "/detail") |
| | | public BaseResult<DetailPageResponse> detail(@Valid @RequestBody DetailPageRequest request){ |
| | | DetailPageResponse response = reportService.detail(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出",notes = "导出") |
| | | @PostMapping(value = "/exports") |
| | | public BaseResult<Object> export(@RequestBody DetailExportsRequest request, HttpServletResponse response) throws IOException { |
| | | reportService.exports(request,response); |
| | | return ResponseUtils.successResponse(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.bussiness; |
| | | |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.screen.ScreenResponse; |
| | | import com.ruoyi.bussiness.service.ScreenService; |
| | | import com.ruoyi.common.core.domain.BaseResult; |
| | | import com.ruoyi.common.core.domain.ResponseUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Validated |
| | | @Api(value = "大屏数据",tags = "大屏数据") |
| | | @RestController |
| | | @RequestMapping(value = "/screen") |
| | | public class ScreenController { |
| | | |
| | | @Autowired |
| | | private ScreenService screenService; |
| | | |
| | | @ApiOperation(value = "数据", notes = "数据") |
| | | @PostMapping(value = "/data") |
| | | public BaseResult<ScreenResponse> data(@RequestBody ReportRequest request) { |
| | | ScreenResponse response = screenService.data(request); |
| | | return ResponseUtils.successResponse(response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.sign.Base64; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 验证码操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "验证码",tags = "验证码") |
| | | @RestController |
| | | public class CaptchaController { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * 生成验证码 |
| | | */ |
| | | @ApiOperation(value = "获取验证码", notes = "获取验证码") |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) { |
| | | return ajax; |
| | | } |
| | | |
| | | // 保存验证码信息 |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // 生成验证码 |
| | | String captchaType = RuoYiConfig.getCaptchaType(); |
| | | if ("math".equals(captchaType)) { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } else if ("char".equals(captchaType)) { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | System.out.println(code); |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // 转换流信息写出 |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try { |
| | | ImageIO.write(image, "jpg", os); |
| | | } catch (IOException e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", "data:image/jpg;base64,"+Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | |
| | | /** |
| | | * 通用请求处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @Api(value = "公共基础接口",tags = "公共基础接口") |
| | | @RequestMapping("/common") |
| | | public class CommonController { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | |
| | | /** |
| | | * 通用上传请求(单个) |
| | | */ |
| | | @ApiOperation(value = "文件上传", notes = "文件上传") |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception { |
| | | try { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | | ajax.put("newFileName", FileUtils.getName(fileName)); |
| | | ajax.put("originalFilename", file.getOriginalFilename()); |
| | | return ajax; |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @ApiOperation(value = "文件上传(多个)", notes = "文件上传(多个)") |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception { |
| | | try { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) { |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ajax; |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 本地资源通用下载 |
| | | // */ |
| | | // @GetMapping("/download/resource") |
| | | // public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) |
| | | // throws Exception { |
| | | // try { |
| | | // if (!FileUtils.checkAllowDownload(resource)) { |
| | | // throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); |
| | | // } |
| | | // // 本地资源路径 |
| | | // String localPath = RuoYiConfig.getProfile(); |
| | | // // 数据库资源地址 |
| | | // String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); |
| | | // // 下载名称 |
| | | // String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); |
| | | // response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | // FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | // FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | // } catch (Exception e) { |
| | | // log.error("下载文件失败", e); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // /** |
| | | // * 通用下载请求 |
| | | // * |
| | | // * @param fileName 文件名称 |
| | | // * @param delete 是否删除 |
| | | // */ |
| | | // @GetMapping("/download") |
| | | // public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) { |
| | | // try { |
| | | // if (!FileUtils.checkAllowDownload(fileName)) { |
| | | // throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); |
| | | // } |
| | | // String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); |
| | | // String filePath = RuoYiConfig.getDownloadPath() + fileName; |
| | | // |
| | | // response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | // FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | // FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | // if (delete) { |
| | | // FileUtils.deleteFile(filePath); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("下载文件失败", e); |
| | | // } |
| | | // } |
| | | } |
New file |
| | |
| | | //package com.ruoyi.web.controller.monitor; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.Collection; |
| | | //import java.util.HashMap; |
| | | //import java.util.List; |
| | | //import java.util.Map; |
| | | //import java.util.Properties; |
| | | //import java.util.Set; |
| | | //import java.util.TreeSet; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.data.redis.core.RedisCallback; |
| | | //import org.springframework.data.redis.core.RedisTemplate; |
| | | //import org.springframework.security.access.prepost.PreAuthorize; |
| | | //import org.springframework.web.bind.annotation.DeleteMapping; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.PathVariable; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | //import com.ruoyi.common.constant.CacheConstants; |
| | | //import com.ruoyi.common.core.domain.AjaxResult; |
| | | //import com.ruoyi.common.utils.StringUtils; |
| | | //import com.ruoyi.system.domain.SysCache; |
| | | // |
| | | ///** |
| | | // * 缓存监控 |
| | | // * |
| | | // * @author ruoyi |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("/monitor/cache") |
| | | //public class CacheController { |
| | | // @Autowired |
| | | // private RedisTemplate<String, String> redisTemplate; |
| | | // |
| | | // private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | // |
| | | // static { |
| | | // caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息")); |
| | | // caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息")); |
| | | // caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典")); |
| | | // caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); |
| | | // caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); |
| | | // caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); |
| | | // caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @GetMapping() |
| | | // public AjaxResult getInfo() throws Exception { |
| | | // Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | // Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | // Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | // |
| | | // Map<String, Object> result = new HashMap<>(3); |
| | | // result.put("info", info); |
| | | // result.put("dbSize", dbSize); |
| | | // |
| | | // List<Map<String, String>> pieList = new ArrayList<>(); |
| | | // commandStats.stringPropertyNames().forEach(key -> { |
| | | // Map<String, String> data = new HashMap<>(2); |
| | | // String property = commandStats.getProperty(key); |
| | | // data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | // data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | // pieList.add(data); |
| | | // }); |
| | | // result.put("commandStats", pieList); |
| | | // return AjaxResult.success(result); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @GetMapping("/getNames") |
| | | // public AjaxResult cache() { |
| | | // return AjaxResult.success(caches); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @GetMapping("/getKeys/{cacheName}") |
| | | // public AjaxResult getCacheKeys(@PathVariable String cacheName) { |
| | | // Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | // return AjaxResult.success(new TreeSet<>(cacheKeys)); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | // public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) { |
| | | // String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | // SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | // return AjaxResult.success(sysCache); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @DeleteMapping("/clearCacheName/{cacheName}") |
| | | // public AjaxResult clearCacheName(@PathVariable String cacheName) { |
| | | // Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | // redisTemplate.delete(cacheKeys); |
| | | // return AjaxResult.success(); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | // public AjaxResult clearCacheKey(@PathVariable String cacheKey) { |
| | | // redisTemplate.delete(cacheKey); |
| | | // return AjaxResult.success(); |
| | | // } |
| | | // |
| | | // @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | // @DeleteMapping("/clearCacheAll") |
| | | // public AjaxResult clearCacheAll() { |
| | | // Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | // redisTemplate.delete(cacheKeys); |
| | | // return AjaxResult.success(); |
| | | // } |
| | | //} |
New file |
| | |
| | | //package com.ruoyi.web.controller.monitor; |
| | | // |
| | | //import org.springframework.security.access.prepost.PreAuthorize; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | //import com.ruoyi.common.core.domain.AjaxResult; |
| | | //import com.ruoyi.framework.web.domain.Server; |
| | | // |
| | | ///** |
| | | // * 服务器监控 |
| | | // * |
| | | // * @author ruoyi |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("/monitor/server") |
| | | //public class ServerController { |
| | | // @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | // @GetMapping() |
| | | // public AjaxResult getInfo() throws Exception { |
| | | // Server server = new Server(); |
| | | // server.copyTo(); |
| | | // return AjaxResult.success(server); |
| | | // } |
| | | //} |
New file |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPasswordService; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | |
| | | /** |
| | | * 系统访问记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) { |
| | | startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "登录日志", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysLogininfor logininfor) { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | util.exportExcel(response, list, "登录日志"); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() { |
| | | logininforService.cleanLogininfor(); |
| | | return success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "账户解锁", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public AjaxResult unlock(@PathVariable("userName") String userName) { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | |
| | | /** |
| | | * 操作日志记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "日志管理",tags = "日志管理") |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | public class SysOperlogController extends BaseController { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysOperLog operLog) { |
| | | startPage(); |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysOperLog operLog) { |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | util.exportExcel(response, list, "操作日志"); |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.DELETE) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/{operIds}") |
| | | public AjaxResult remove(@PathVariable Long[] operIds) { |
| | | return toAjax(operLogService.deleteOperLogByIds(operIds)); |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.CLEAN) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() { |
| | | operLogService.cleanOperLog(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysUserOnline; |
| | | import com.ruoyi.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * 在线用户监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | public class SysUserOnlineController extends BaseController { |
| | | @Autowired |
| | | private ISysUserOnlineService userOnlineService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } else if (StringUtils.isNotEmpty(ipaddr)) { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } else { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强退用户 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "在线用户", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | //import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 参数配置 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | public class SysConfigController extends BaseController { |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * 获取参数配置列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) { |
| | | startPage(); |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | // ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | // util.exportExcel(response, list, "参数数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数键名查询参数值 |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) { |
| | | if (!configService.checkConfigKeyUnique(config)) { |
| | | return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) { |
| | | if (!configService.checkConfigKeyUnique(config)) { |
| | | return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新参数缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * 部门信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | public class SysDeptController extends BaseController { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增部门 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) { |
| | | if (!deptService.checkDeptNameUnique(dept)) { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } else if (dept.getParentId().equals(deptId)) { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
| | | } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) { |
| | | return error("该部门包含未停用的子部门!"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | return toAjax(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 删除部门 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) { |
| | | if (deptService.hasChildByDeptId(deptId)) { |
| | | return warn("存在下级部门,不允许删除"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) { |
| | | return warn("部门存在用户,不允许删除"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return toAjax(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "字典控制器",tags = "字典控制器") |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | public class SysDictDataController extends BaseController { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "字典数据"); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @ApiOperation(value = "获取字典", notes = "获取字典") |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据信息 |
| | | */ |
| | | @ApiOperation(value = "根据字典类型查询字典数据信息", notes = "根据字典类型查询字典数据信息") |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | public class SysDictTypeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) { |
| | | startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | util.exportExcel(response, list, "字典类型"); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) { |
| | | return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) { |
| | | return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 首页 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysIndexController { |
| | | /** |
| | | * 系统基础配置 |
| | | */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** |
| | | * 访问首页,提示语 |
| | | */ |
| | | @RequestMapping("/") |
| | | public String index() { |
| | | return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "登录控制器",tags = "登录控制器") |
| | | @RestController |
| | | public class SysLoginController { |
| | | |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 登录方法 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "登录", notes = "登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, token); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | @ApiOperation(value = "获取用户信息", notes = "获取用户信息") |
| | | @GetMapping("/getInfo") |
| | | public AjaxResult getInfo() { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | if (!loginUser.getPermissions().equals(permissions)) { |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由信息 |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @ApiOperation(value = "获取路由信息", notes = "获取路由信息") |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 菜单信息 |
| | | * */ |
| | | @Api(value = "菜单控制器",tags = "菜单控制器") |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | public class SysMenuController extends BaseController { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysMenu menu) { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menus); |
| | | } |
| | | |
| | | /** |
| | | * 根据菜单编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) { |
| | | return success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单下拉树列表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * 加载对应角色菜单列表树 |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增菜单 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) { |
| | | if (!menuService.checkMenuNameUnique(menu)) { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | return toAjax(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 修改菜单 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) { |
| | | if (!menuService.checkMenuNameUnique(menu)) { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } else if (menu.getMenuId().equals(menu.getParentId())) { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | return toAjax(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) { |
| | | if (menuService.hasChildByMenuId(menuId)) { |
| | | return warn("存在子菜单,不允许删除"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) { |
| | | return warn("菜单已分配,不允许删除"); |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * 公告 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | public class SysNoticeController extends BaseController { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * 获取通知公告列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) { |
| | | startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知公告编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')") |
| | | @Log(title = "通知公告", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) { |
| | | notice.setCreateBy(getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')") |
| | | @Log(title = "通知公告", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) { |
| | | notice.setUpdateBy(getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 删除通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:remove')") |
| | | @Log(title = "通知公告", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * 岗位信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | public class SysPostController extends BaseController { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) { |
| | | startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | util.exportExcel(response, list, "岗位数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) { |
| | | if (!postService.checkPostNameUnique(post)) { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } else if (!postService.checkPostCodeUnique(post)) { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) { |
| | | if (!postService.checkPostNameUnique(post)) { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } else if (!postService.checkPostCodeUnique(post)) { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取岗位选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.Map; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 个人信息 业务处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | public class SysProfileController extends BaseController { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 个人信息 |
| | | */ |
| | | @GetMapping |
| | | public AjaxResult profile() { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | AjaxResult ajax = AjaxResult.success(user); |
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhonenumber(user.getPhonenumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) { |
| | | return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) { |
| | | return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) { |
| | | // 更新缓存用户信息 |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改个人信息异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public AjaxResult updatePwd(@RequestBody Map<String, String> params) { |
| | | String oldPassword = params.get("oldPassword"); |
| | | String newPassword = params.get("newPassword"); |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) { |
| | | return error("修改密码失败,旧密码错误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) { |
| | | return error("新密码不能与旧密码相同"); |
| | | } |
| | | newPassword = SecurityUtils.encryptPassword(newPassword); |
| | | if (userService.resetUserPwd(userName, newPassword) > 0) { |
| | | // 更新缓存用户密码 |
| | | loginUser.getUser().setPassword(newPassword); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改密码异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 头像上传 |
| | | */ |
| | | @Log(title = "用户头像", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception { |
| | | if (!file.isEmpty()) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | // 更新缓存用户头像 |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | return ajax; |
| | | } |
| | | } |
| | | return error("上传图片异常,请联系管理员"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.RegisterBody; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.SysRegisterService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 注册验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysRegisterController extends BaseController { |
| | | @Autowired |
| | | private SysRegisterService registerService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public AjaxResult register(@RequestBody RegisterBody user) { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { |
| | | return error("当前系统没有开启注册功能!"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 角色信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "角色管理控制器",tags = "角色管理控制器") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | public class SysRoleController extends BaseController { |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @ApiOperation(value = "角色列表", notes = "角色列表") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysRole role) { |
| | | startPage(); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "角色管理", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:role:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysRole role) { |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); |
| | | util.exportExcel(response, list, "角色数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据角色编号获取详细信息 |
| | | */ |
| | | @ApiOperation(value = "根据角色编号获取详细信息", notes = "根据角色编号获取详细信息") |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return success(roleService.selectRoleById(roleId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增角色 |
| | | */ |
| | | @ApiOperation(value = "新增角色", notes = "新增角色") |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @Log(title = "角色管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysRole role) { |
| | | role.setRoleKey(RandomUtil.randomString(20)); |
| | | if (!roleService.checkRoleNameUnique(role)) { |
| | | return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
| | | } else if (!roleService.checkRoleKeyUnique(role)) { |
| | | return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
| | | } |
| | | role.setCreateBy(getUsername()); |
| | | return toAjax(roleService.insertRole(role)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | @ApiOperation(value = "修改保存角色", notes = "修改保存角色") |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysRole role) { |
| | | role.setRoleKey(RandomUtil.randomString(20)); |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | if (!roleService.checkRoleNameUnique(role)) { |
| | | return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
| | | } else if (!roleService.checkRoleKeyUnique(role)) { |
| | | return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
| | | } |
| | | role.setUpdateBy(getUsername()); |
| | | |
| | | if (roleService.updateRole(role) > 0) { |
| | | // 更新缓存用户权限 |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) { |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return success(); |
| | | } |
| | | return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存数据权限 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return toAjax(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | role.setUpdateBy(getUsername()); |
| | | return toAjax(roleService.updateRoleStatus(role)); |
| | | } |
| | | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @ApiOperation(value = "删除角色", notes = "删除角色") |
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | public AjaxResult remove(@PathVariable Long[] roleIds) { |
| | | return toAjax(roleService.deleteRoleByIds(roleIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取角色选择框列表 |
| | | */ |
| | | @ApiOperation(value = "获取角色选择框列表", notes = "获取角色选择框列表") |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() { |
| | | return success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | @ApiOperation(value = "查询已分配用户角色列表", notes = "查询已分配用户角色列表") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | @ApiOperation(value = "查询未分配用户角色列表", notes = "查询未分配用户角色列表") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 取消授权用户 |
| | | */ |
| | | @ApiOperation(value = "取消授权用户", notes = "取消授权用户") |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) { |
| | | return toAjax(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | /** |
| | | * 批量取消授权用户 |
| | | */ |
| | | @ApiOperation(value = "批量取消授权用户", notes = "批量取消授权用户") |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) { |
| | | return toAjax(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 批量选择用户授权 |
| | | */ |
| | | @ApiOperation(value = "批量选择用户授权", notes = "批量选择用户授权") |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "用户管理控制器",tags = "用户管理控制器") |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | public class SysUserController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户列表", notes = "获取用户列表") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUser user) { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "用户管理", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUser user) { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.exportExcel(response, list, "用户数据"); |
| | | } |
| | | |
| | | @Log(title = "用户管理", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:import')") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | List<SysUser> userList = util.importExcel(file.getInputStream()); |
| | | String operName = getUsername(); |
| | | String message = userService.importUser(userList, updateSupport, operName); |
| | | return success(message); |
| | | } |
| | | |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.importTemplateExcel(response, "用户数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号获取详细信息 |
| | | */ |
| | | @ApiOperation(value = "根据用户编号获取详细信息", notes = "根据用户编号获取详细信息") |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping(value = {"/", "/{userId}"}) |
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | if (StringUtils.isNotNull(userId)) { |
| | | // userService.checkUserDataScope(userId); |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | ajax.put(AjaxResult.DATA_TAG, sysUser); |
| | | ajax.put("postIds", postService.selectPostListByUserId(userId)); |
| | | ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); |
| | | } |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | @ApiOperation(value = "新增用户", notes = "新增用户") |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) { |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | return toAjax(userService.insertUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @ApiOperation(value = "修改用户", notes = "修改用户") |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | @ApiOperation(value = "删除用户", notes = "删除用户") |
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) { |
| | | if (ArrayUtils.contains(userIds, getUserId())) { |
| | | return error("当前用户不能删除"); |
| | | } |
| | | return toAjax(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @ApiOperation(value = "重置密码", notes = "重置密码") |
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @ApiOperation(value = "状态修改", notes = "状态修改") |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | @ApiOperation(value = "根据用户编号获取授权角色", notes = "根据用户编号获取授权角色") |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | @ApiOperation(value = "用户授权角色", notes = "用户授权角色") |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { |
| | | userService.checkUserDataScope(userId); |
| | | roleService.checkRoleDataScope(roleIds); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.task; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.ruoyi.bussiness.enums.MessageTypeEnum; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import com.ruoyi.bussiness.utils.PaymentCycleHelper; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Component |
| | | public class MessageTask { |
| | | |
| | | |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | @Autowired |
| | | private PlacementBatchHouseholdService placementBatchHouseholdService; |
| | | |
| | | |
| | | // 每年 12月、3月、6月、9月 的 15号早上9点提醒(季度前一个月15号) |
| | | @Scheduled(cron = "0 0 9 15 12,3,6,9 ?") |
| | | public void remindQuarterlyPaymentMid() { |
| | | String month = PaymentCycleHelper.getFirstPaymentCycle(new Date()); |
| | | BigDecimal money = placementBatchHouseholdService.getPayMoneyByQuarter(month); |
| | | SysNotice sysNotice = new SysNotice(); |
| | | String title = StrUtil.format(MessageTypeEnum.PLACEMENT_MONTH_PAY.getMessage(), money); |
| | | sysNotice.setNoticeTitle(title); |
| | | sysNotice.setStatus("0"); |
| | | sysNotice.setNoticeType("1"); |
| | | sysNotice.setCountNum(money); |
| | | sysNotice.setCreateTime(new Date()); |
| | | sysNotice.setUpdateTime(new Date()); |
| | | sysNoticeService.save(sysNotice); |
| | | } |
| | | |
| | | // 每年 3月、6月、9月、12月 的最后一天早上9点提醒(季度前一个月最后一天) |
| | | //月底提醒:(3月/12月) |
| | | @Scheduled(cron = "0 0 9 31 3,12 ?") |
| | | public void remindQuarterlyPaymentEnd_Mar_Dec() { |
| | | String month = PaymentCycleHelper.getFirstPaymentCycle(new Date()); |
| | | BigDecimal money = placementBatchHouseholdService.getPayMoneyByQuarter(month); |
| | | SysNotice sysNotice = new SysNotice(); |
| | | String title = StrUtil.format(MessageTypeEnum.PLACEMENT_MONTH_PAY.getMessage(), money); |
| | | sysNotice.setNoticeTitle(title); |
| | | sysNotice.setStatus("0"); |
| | | sysNotice.setNoticeType("1"); |
| | | sysNotice.setCountNum(money); |
| | | sysNotice.setCreateTime(new Date()); |
| | | sysNotice.setUpdateTime(new Date()); |
| | | sysNoticeService.save(sysNotice); |
| | | } |
| | | |
| | | /** |
| | | * 每年 3月、6月、9月、12月 的最后一天早上9点提醒(季度前一个月最后一天) |
| | | * 月底提醒:(6月/9月) |
| | | */ |
| | | @Scheduled(cron = "0 0 9 30 6,9 ?") |
| | | public void remindQuarterlyPaymentEnd_Jun_Sep() { |
| | | String month = PaymentCycleHelper.getFirstPaymentCycle(new Date()); |
| | | BigDecimal money = placementBatchHouseholdService.getPayMoneyByQuarter(month); |
| | | SysNotice sysNotice = new SysNotice(); |
| | | String title = StrUtil.format(MessageTypeEnum.PLACEMENT_MONTH_PAY.getMessage(), money); |
| | | sysNotice.setNoticeTitle(title); |
| | | sysNotice.setStatus("0"); |
| | | sysNotice.setNoticeType("1"); |
| | | sysNotice.setCountNum(money); |
| | | sysNotice.setCreateTime(new Date()); |
| | | sysNotice.setUpdateTime(new Date()); |
| | | sysNoticeService.save(sysNotice); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.ApiKey; |
| | | import springfox.documentation.service.AuthorizationScope; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.service.SecurityReference; |
| | | import springfox.documentation.service.SecurityScheme; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | /** |
| | | * Swagger2的接口配置 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | | public class SwaggerConfig |
| | | { |
| | | /** 系统基础配置 */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** 是否开启swagger */ |
| | | @Value("${swagger.enabled}") |
| | | private boolean enabled; |
| | | |
| | | /** 设置请求的统一前缀 */ |
| | | @Value("${swagger.pathMapping}") |
| | | private String pathMapping; |
| | | |
| | | /** |
| | | * 创建API |
| | | */ |
| | | @Bean |
| | | public Docket createRestApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | // 是否启用Swagger |
| | | .enable(enabled) |
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
| | | .apiInfo(apiInfo()) |
| | | // 设置哪些接口暴露给Swagger展示 |
| | | .select() |
| | | // 扫描所有有注解的api,用这种方式更灵活 |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | // 扫描指定包中的swagger注解 |
| | | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) |
| | | .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | /* 设置安全模式,swagger可以设置访问token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping(pathMapping); |
| | | } |
| | | |
| | | /** |
| | | * 安全模式,这里指定token通过Authorization头请求头传递 |
| | | */ |
| | | private List<SecurityScheme> securitySchemes() |
| | | { |
| | | List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); |
| | | return apiKeyList; |
| | | } |
| | | |
| | | /** |
| | | * 安全上下文 |
| | | */ |
| | | private List<SecurityContext> securityContexts() |
| | | { |
| | | List<SecurityContext> securityContexts = new ArrayList<>(); |
| | | securityContexts.add( |
| | | SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .operationSelector(o -> o.requestMappingPattern().matches("/.*")) |
| | | .build()); |
| | | return securityContexts; |
| | | } |
| | | |
| | | /** |
| | | * 默认的安全上引用 |
| | | */ |
| | | private List<SecurityReference> defaultAuth() |
| | | { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | List<SecurityReference> securityReferences = new ArrayList<>(); |
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); |
| | | return securityReferences; |
| | | } |
| | | |
| | | /** |
| | | * 添加摘要信息 |
| | | */ |
| | | private ApiInfo apiInfo() |
| | | { |
| | | // 用ApiInfoBuilder进行定制 |
| | | return new ApiInfoBuilder() |
| | | // 设置标题 |
| | | .title("标题:chongzhou_接口文档") |
| | | // 描述 |
| | | .description("") |
| | | // 作者信息 |
| | | .contact(new Contact(ruoyiConfig.getName(), null, null)) |
| | | // 版本 |
| | | .version("版本号:" + ruoyiConfig.getVersion()) |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | restart.include.json=/com.alibaba.fastjson2.*.jar |
New file |
| | |
| | | # 数据源配置 |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:10633/chongzhou?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: ChongZhou@2025! |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置白名单,不填则允许所有访问 |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # 控制台管理用户名和密码 |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # 慢SQL记录 |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
New file |
| | |
| | | # 项目相关配置 |
| | | ruoyi: |
| | | # 名称 |
| | | name: chongzhou |
| | | # 版本 |
| | | version: 3.8.9 |
| | | # 版权年份 |
| | | copyrightYear: 2025 |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/congzhouApp/javaProject/pic |
| | | # 获取ip地址开关 |
| | | addressEnabled: false |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8888 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: /api |
| | | tomcat: |
| | | # tomcat的URI编码 |
| | | uri-encoding: UTF-8 |
| | | # 连接数满后的排队数,默认为100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcat最大线程数,默认为200 |
| | | max: 800 |
| | | # Tomcat启动初始化的线程数,默认值10 |
| | | min-spare: 100 |
| | | |
| | | # 日志配置 |
| | | logging: |
| | | level: |
| | | com.ruoyi: debug |
| | | org.springframework: warn |
| | | |
| | | # 用户配置 |
| | | user: |
| | | password: |
| | | # 密码最大错误次数 |
| | | maxRetryCount: 5 |
| | | # 密码锁定时间(默认10分钟) |
| | | lockTime: 10 |
| | | |
| | | # Spring配置 |
| | | spring: |
| | | # 资源信息 |
| | | messages: |
| | | # 国际化资源文件路径 |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: druid |
| | | # 文件上传 |
| | | servlet: |
| | | multipart: |
| | | # 单个文件大小 |
| | | max-file-size: 10MB |
| | | # 设置总上传的文件大小 |
| | | max-request-size: 20MB |
| | | # 服务模块 |
| | | devtools: |
| | | restart: |
| | | # 热部署开关 |
| | | enabled: true |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: ChongZhou@2025! |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | jedis: |
| | | pool: |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 8 |
| | | # 连接池的最大数据库连接数 |
| | | max-active: 8 |
| | | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: -1ms |
| | | time-between-eviction-runs: |
| | | |
| | | # token配置 |
| | | token: |
| | | # 令牌自定义标识 |
| | | header: Authorization |
| | | # 令牌密钥 |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # 令牌有效期(默认1440分钟,24小时) |
| | | expireTime: 1440 |
| | | |
| | | ## MyBatis配置 |
| | | #mybatis: |
| | | # # 搜索指定包别名 |
| | | # typeAliasesPackage: com.ruoyi.**.domain |
| | | # # 配置mapper的扫描,找到所有的mapper.xml映射文件 |
| | | # mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # # 加载全局的配置文件 |
| | | # configLocation: classpath:mybatis/mybatis-config.xml |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/**/*Mapper.xml |
| | | typeAliasesPackage: com.ruoyi.**.domain |
| | | # config-location: classpath:mybatis/mybatis-config.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | cache-enabled: true |
| | | use-generated-keys: true |
| | | default-executor-type: simple |
| | | |
| | | # PageHelper分页插件 |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swagger配置 |
| | | swagger: |
| | | # 是否开启swagger |
| | | enabled: true |
| | | # 请求前缀 |
| | | pathMapping: / |
| | | |
| | | # 防止XSS攻击 |
| | | xss: |
| | | # 过滤开关 |
| | | enabled: true |
| | | # 排除链接(多个用逗号分隔) |
| | | excludes: /system/notice |
| | | # 匹配链接 |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
New file |
| | |
| | | #错误消息 |
| | | not.null=* 必须填写 |
| | | user.jcaptcha.error=验证码错误 |
| | | user.jcaptcha.expire=验证码已失效 |
| | | user.not.exists=用户不存在/密码错误 |
| | | user.password.not.match=用户不存在/密码错误 |
| | | user.password.retry.limit.count=密码输入错误{0}次 |
| | | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 |
| | | user.password.delete=对不起,您的账号已被删除 |
| | | user.blocked=用户已封禁,请联系管理员 |
| | | role.blocked=角色已封禁,请联系管理员 |
| | | login.blocked=很遗憾,访问IP已被列入系统黑名单 |
| | | user.logout.success=退出成功 |
| | | |
| | | length.not.valid=长度必须在{min}到{max}个字符之间 |
| | | |
| | | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 |
| | | user.password.not.valid=* 5-50个字符 |
| | | |
| | | user.email.not.valid=邮箱格式错误 |
| | | user.mobile.phone.number.not.valid=手机号格式错误 |
| | | user.login.success=登录成功 |
| | | user.register.success=注册成功 |
| | | user.notfound=请重新登录 |
| | | user.forcelogout=管理员强制退出,请重新登录 |
| | | user.unknown.error=未知错误,请重新登录 |
| | | |
| | | ##文件上传消息 |
| | | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB! |
| | | upload.filename.exceed.length=上传的文件名最长{0}个字符 |
| | | |
| | | ##权限 |
| | | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] |
| | | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] |
| | | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] |
| | | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] |
| | | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] |
| | | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="D:/congzhouApp/javaProject/logs" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- 控制台输出 --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统日志输出 --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-info.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>INFO</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-error.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>ERROR</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 用户访问日志输出 --> |
| | | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 按天回滚 daily --> |
| | | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--系统操作日志--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | |
| | | <!--系统用户操作日志--> |
| | | <logger name="sys-user" level="info"> |
| | | <appender-ref ref="sys-user"/> |
| | | </logger> |
| | | </configuration> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE configuration |
| | | PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| | | <configuration> |
| | | <!-- 全局参数 --> |
| | | <settings> |
| | | <!-- 使全局的映射器启用或禁用缓存 --> |
| | | <setting name="cacheEnabled" value="true" /> |
| | | <!-- 允许JDBC 支持自动生成主键 --> |
| | | <setting name="useGeneratedKeys" value="true" /> |
| | | <!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 --> |
| | | <setting name="defaultExecutorType" value="SIMPLE" /> |
| | | <!-- 指定 MyBatis 所用日志的具体实现 --> |
| | | <setting name="logImpl" value="SLF4J" /> |
| | | <!-- 使用驼峰命名法转换字段 --> |
| | | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --> |
| | | </settings> |
| | | |
| | | </configuration> |
New file |
| | |
| | | <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/maven-v4_0_0.xsd"> |
| | | <parent> |
| | | <artifactId>chongzhou</artifactId> |
| | | <groupId>com.cz</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | |
| | | <groupId>com.cz</groupId> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <artifactId>cz-bussiness</artifactId> |
| | | |
| | | <description> |
| | | 业务模块 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- 通用工具--> |
| | | <dependency> |
| | | <groupId>com.cz</groupId> |
| | | <artifactId>cz-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.cz</groupId> |
| | | <artifactId>cz-system</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_compensate") |
| | | public class Compensate { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String configKey; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private BigDecimal configValue; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_data_file") |
| | | public class DataFile { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "资料名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "附件名称") |
| | | private String attachName; |
| | | |
| | | @ApiModelProperty(value = "附件链接") |
| | | private String attachUrl; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createUser; |
| | | |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName(value = "t_placement") |
| | | public class Placement { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "项目启动时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "社区") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "组") |
| | | private String groupName; |
| | | |
| | | @ApiModelProperty(value = "户主") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "家庭成员名称") |
| | | private String familyName; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "关系") |
| | | private String relation; |
| | | |
| | | @ApiModelProperty(value = "人员类型") |
| | | private String personType; |
| | | |
| | | @ApiModelProperty(value = "家庭身份证号码") |
| | | private String familyIdCard; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "出生年月") |
| | | private Date birthday; |
| | | |
| | | @ApiModelProperty(value = "安置方式") |
| | | private String ways; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "原始拆迁时领取过度费时间") |
| | | private Date originCollectionTime; |
| | | |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String mobile; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "上次过度费发放时间(起)") |
| | | private Date lastBeginTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "上次过度费发放时间(止)") |
| | | private Date lastEndTime; |
| | | |
| | | @ApiModelProperty(value = "安置状态(1已安置 0未安置)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "剩余未安置面积") |
| | | private BigDecimal noHouseArea; |
| | | |
| | | @ApiModelProperty(value = "剩余未安置商铺面积") |
| | | private BigDecimal noShopArea; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "购房信息") |
| | | private List<PlacementBatchHousehold> households; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_placement_apply") |
| | | public class PlacementApply { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "申请总户数") |
| | | private Integer householdsNum; |
| | | |
| | | @ApiModelProperty(value = "申请总人数") |
| | | private Integer personNum; |
| | | |
| | | @ApiModelProperty(value = "申请总金额(万元)") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "25%首付款") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "应安置总面积") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "状态(0待审核 1已通过 2已驳回)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | private String reason; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "审核时间") |
| | | private Date approveTime; |
| | | |
| | | @ApiModelProperty(value = "审核人") |
| | | private Long approveId; |
| | | |
| | | @ApiModelProperty(value = "审核人名称") |
| | | private String approveName; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createId; |
| | | |
| | | @ApiModelProperty(value = "创建人名称") |
| | | private String createUser; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_placement_apply_record") |
| | | public class PlacementApplyRecord { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "申请表id") |
| | | private Long placementApplyId; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | private Date demolitionTime; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "身份证不在安置库警告(0不警告 1警告") |
| | | private Integer idCardExistsWarn; |
| | | |
| | | @ApiModelProperty(value = "身份证重复提醒警告(0不警告 1警告") |
| | | private Integer idCardNoWarn; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String mobile; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数-集体经济组织成员") |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数-非集体经济组织成员") |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数-合计") |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员") |
| | | private String waitFamilyNames; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员(警告)") |
| | | private Integer waitFamilyNamesWarn; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员不在安置库(警告)") |
| | | private Integer waitFamilyNamesNoWarn; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "应补偿面积数据异常警告") |
| | | private Integer waitFamilyAreaWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿金额-新建商品住房、商业用房、停车位") |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额-二手住房") |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ApiModelProperty(value = "多个购房活动警告(0正常 1异常)") |
| | | private Integer compensationAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)警告") |
| | | private Integer compensationSumWarn; |
| | | |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "首付款警告") |
| | | private Integer downPaymentAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(警告)") |
| | | private Integer quarterPayAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴警告") |
| | | private Integer subsidyAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "购房差异情况") |
| | | private String situation; |
| | | |
| | | @ApiModelProperty(value = "审核人id") |
| | | private Long approveId; |
| | | |
| | | @ApiModelProperty(value = "审核人名称") |
| | | private String approveName; |
| | | |
| | | @ApiModelProperty(value = "审核时间") |
| | | private Date approveTime; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | private Long createId; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | private String createUser; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "核对状态") |
| | | private Integer checks; |
| | | |
| | | @ApiModelProperty(value = "集体面积") |
| | | private BigDecimal orgArea = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "非集体面积") |
| | | private BigDecimal noOrgArea = BigDecimal.ZERO; |
| | | } |
| | | |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(description = "安置批次实体类") |
| | | @TableName(value = "t_placement_batch") |
| | | public class PlacementBatch { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "申请总户数") |
| | | private Integer householdsNum; |
| | | |
| | | @ApiModelProperty(value = "申请总人数") |
| | | private Integer personNum; |
| | | |
| | | @ApiModelProperty(value = "补偿总金额(万元)") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "25%首付款") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房") |
| | | private BigDecimal newArea; |
| | | |
| | | @ApiModelProperty(value = "二手住房") |
| | | private BigDecimal oldArea; |
| | | |
| | | @ApiModelProperty(value = "新建商业用房") |
| | | private BigDecimal businessArea; |
| | | |
| | | @ApiModelProperty(value = "车位(个数)") |
| | | private Integer parkingArea; |
| | | |
| | | @ApiModelProperty(value = "状态(0待审核 1已通过 2已驳回)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "审核时间") |
| | | private Date approveTime; |
| | | |
| | | @ApiModelProperty(value = "审核人") |
| | | private Long approveId; |
| | | |
| | | @ApiModelProperty(value = "审核人名称") |
| | | private String approveName; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createId; |
| | | |
| | | @ApiModelProperty(value = "创建人名称") |
| | | private String createUser; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime = new Date(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_placement_batch_asset") |
| | | @ApiModel(description = "安置批次资产实体类") |
| | | public class PlacementBatchAsset { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "批次ID") |
| | | private Long placementBatchId; |
| | | |
| | | @ApiModelProperty(value = "镇(街道)") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "户主未通过安置申请提示(1未通过)") |
| | | private Integer householdHeadWarn; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "身份证不存在安置库") |
| | | private Integer idCardWarn; |
| | | |
| | | @ApiModelProperty(value = "应安置人数") |
| | | private Integer resettledNum; |
| | | |
| | | @ApiModelProperty(value = "所有家庭人员应安置面积") |
| | | private BigDecimal resettledArea; |
| | | |
| | | @ApiModelProperty(value = "应补偿面积数据异常") |
| | | private Integer waitFamilyAreaWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿单价标准-新建商品房、商业用") |
| | | private BigDecimal priceNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿单价标准-二手住房") |
| | | private BigDecimal priceOldAmount; |
| | | |
| | | @ApiModelProperty(value = "多个购房情况警告(新建房和二手住房都录入了)") |
| | | private Integer twoPriceWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿标准数据异常(不等于补偿协议里面写的)") |
| | | private Integer priceAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿总价") |
| | | private BigDecimal compensationAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿总价异常") |
| | | private Integer compensationSumWarn; |
| | | |
| | | @ApiModelProperty(value = "25%首付款") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "首付款警告") |
| | | private Integer downPaymentAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款警告") |
| | | private Integer quarterPayAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴警告") |
| | | private Integer subsidyAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "核对状态") |
| | | private Integer checks; |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName(value = "t_placement_batch_household") |
| | | @ApiModel(description = "安置批次家庭实体类") |
| | | public class PlacementBatchHousehold { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "安置批次ID") |
| | | private Long placementBatchId; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | private Date demolitionTime; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "未通过安置申请警告") |
| | | private Integer householdHeadWarn; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "身份证不存在安置库警告 0: 不警告, 1: 警告") |
| | | private Integer idCardWarn; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String mobile; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 集体经济组织成员") |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 非集体经济组织成员") |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 合计") |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员") |
| | | private String waitFamilyNames; |
| | | |
| | | @ApiModelProperty(value = "家庭成员(警告)") |
| | | private Integer waitFamilyNamesWarn; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员不在安置库(警告)") |
| | | private Integer waitFamilyNamesNoWarn; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积警告") |
| | | private Integer waitFamilyAreaWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿金额 - 新建商品住房、商业用房、停车位") |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额 - 二手住房") |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ApiModelProperty(value = "多个购房情况警告") |
| | | private Integer compensationAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)警告") |
| | | private Integer compensationSumWarn; |
| | | |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "首付款警告") |
| | | private Integer downPaymentAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "季度款警告") |
| | | private Integer quarterPayAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴警告") |
| | | private Integer subsidyAmountWarn; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "凭证发放时间") |
| | | private Date certificateTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "购房时间") |
| | | private Date buyTime; |
| | | |
| | | @ApiModelProperty(value = "成交金额") |
| | | private BigDecimal dealAmount; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 楼盘名称") |
| | | private String newHousingName; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 价格") |
| | | private BigDecimal newHousingArea; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 套数") |
| | | private Integer newHousingNum; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 小区名称") |
| | | private String oldHousingName; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 面积") |
| | | private BigDecimal oldHousingArea; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 套数") |
| | | private Integer oldHousingNum; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 名称") |
| | | private String buildHousingName; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房-金额") |
| | | private BigDecimal buildHousingAmount; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 面积") |
| | | private BigDecimal buildHousingArea; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 套数") |
| | | private Integer buildHousingNum; |
| | | |
| | | @ApiModelProperty(value = "新建停车位 - 楼盘名称") |
| | | private String newStopName; |
| | | |
| | | @ApiModelProperty(value = "新建停车位 - 金额(万元)") |
| | | private BigDecimal newStopArea; |
| | | |
| | | @ApiModelProperty(value = "新建停车位个数") |
| | | private Integer newStopNum; |
| | | |
| | | @ApiModelProperty(value = "面积低于标准警告") |
| | | private Integer areaWarn; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "自主购房签订时间") |
| | | private Date signTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "25%补偿款及过渡补贴支付时间") |
| | | private Date compensationPayTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第一年") |
| | | private Date remainingTime1; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第二年") |
| | | private Date remainingTime2; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第三年") |
| | | private Date remainingTime3; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第四年") |
| | | private Date remainingTime4; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第五年") |
| | | private Date remainingTime5; |
| | | |
| | | @ApiModelProperty(value = "付款周期") |
| | | private String cycle; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "核对状态") |
| | | private Integer checks; |
| | | |
| | | @ApiModelProperty(value = "集体面积") |
| | | @TableField(exist = false) |
| | | private BigDecimal orgArea = BigDecimal.ZERO; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "非集体面积") |
| | | private BigDecimal noOrgArea = BigDecimal.ZERO; |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("t_placement_error") |
| | | public class PlacementError { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "错误总计") |
| | | private Integer errorNum = 0; |
| | | |
| | | @ApiModelProperty(value = "安置人员信息错误") |
| | | private Integer settleNum = 0; |
| | | |
| | | @ApiModelProperty(value = "安置面积错误") |
| | | private Integer areaNum = 0; |
| | | |
| | | @ApiModelProperty(value = "补偿金额") |
| | | private Integer compensationNum = 0; |
| | | |
| | | @ApiModelProperty(value = "房源面积错误") |
| | | private Integer houseNum = 0; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.enums; |
| | | |
| | | |
| | | /** |
| | | * 补偿标准枚举类 |
| | | */ |
| | | public enum CompensateEnum { |
| | | |
| | | //适用房源 |
| | | HOUSING("housing", "自主购买的商品住房(含新建商品住房和一手住房)建筑面积,以户为单位人均不低于config_value"), |
| | | //应安置面积 |
| | | BEFORE_ORG_AREA("before_org_area", "拆迁时间在14年之前,集体经济组织成员应安置面积为:before_org_area"), |
| | | BEFORE_NO_ORG_AREA("before_no_org_area", "拆迁时间在14年之前,非集体经济组织成员应安置面积为:before_no_org_area"), |
| | | AFTER_ORG_AREA("after_org_area", "拆迁时间在14年之后,集体经济组织成员应安置面积为:after_org_area"), |
| | | AFTER_NO_ORG_AREA("after_no_org_area", "拆迁时间在14年之后,非集体经济组织成员应安置面积为:after_no_org_area"), |
| | | |
| | | //自主购房补贴 |
| | | BEFORE_BUY_ORG_APPOINT1("before_buy_org_appoint1", "拆迁时间在14年之前自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | BEFORE_BUY_ORG_APPOINT2("before_buy_org_appoint2", "拆迁时间在14年之前自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->集体经济组织成员-> \"二手房\""), |
| | | BEFORE_BUY_NO_ORG_APPOINT1("before_buy_no_org_appoint1", "拆迁时间在14年之前自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->非集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | BEFORE_BUY_NO_ORG_APPOINT2("before_buy_no_org_appoint2", "拆迁时间在14年之前自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->非集体经济组织成员-> \"二手房\""), |
| | | BEFORE_BUY_ORG_OTHER1("before_buy_org_other1", "拆迁时间在14年之前自主购房安置补偿标准->其余街道->集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | BEFORE_BUY_ORG_OTHER2("before_buy_org_other2", "拆迁时间在14年之前自主购房安置补偿标准->其余街道->集体经济组织成员-> \"二手房\""), |
| | | BEFORE_BUY_NO_ORG_OTHER1("before_buy_no_org_other1", "拆迁时间在14年之前自主购房安置补偿标准->其余街道->非集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | BEFORE_BUY_NO_ORG_OTHER2("before_buy_no_org_other2", "拆迁时间在14年之前自主购房安置补偿标准->其余街道->非集体经济组织成员-> \"二手房\""), |
| | | |
| | | AFTER_BUY_ORG_APPOINT1("after_buy_org_appoint1", "拆迁时间在14年之后自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | AFTER_BUY_ORG_APPOINT2("after_buy_org_appoint2", "拆迁时间在14年之后自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->集体经济组织成员-> \"二手房\""), |
| | | AFTER_BUY_NO_ORG_APPOINT1("after_buy_no_org_appoint1", "拆迁时间在14年之后自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->非集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | AFTER_BUY_NO_ORG_APPOINT2("after_buy_no_org_appoint2", "拆迁时间在14年之后自主购房安置补偿标准->崇阳街道、崇庆街道、羊马街道、大划街道->非集体经济组织成员-> \"二手房\""), |
| | | AFTER_BUY_ORG_OTHER1("after_buy_org_other1", "拆迁时间在14年之后自主购房安置补偿标准->其他街道->集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | AFTER_BUY_ORG_OTHER2("after_buy_org_other2", "拆迁时间在14年之后自主购房安置补偿标准->其他街道->集体经济组织成员-> \"二手房\""), |
| | | AFTER_BUY_NO_ORG_OTHER1("after_buy_no_org_other1", "拆迁时间在14年之后自主购房安置补偿标准->其他街道->非集体经济组织成员-> \"新建商品房、停车位、商业用房\""), |
| | | AFTER_BUY_NO_ORG_OTHER2("after_buy_no_org_other2", "拆迁时间在14年之后自主购房安置补偿标准->其他街道->非集体经济组织成员-> \"二手房\""), |
| | | |
| | | //过渡补偿 |
| | | SUBSIDIES("subsidies", "过渡费补偿标准(元/人/月)") |
| | | ; |
| | | |
| | | |
| | | private final String code; |
| | | private final String type; |
| | | |
| | | CompensateEnum(String code, String type) { |
| | | this.code = code; |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public static CompensateEnum getEnumByKey(String code) { |
| | | for (CompensateEnum v : CompensateEnum.values()) { |
| | | if (v.getCode().equals(code)) { |
| | | return v; |
| | | } |
| | | } |
| | | return HOUSING; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.enums; |
| | | |
| | | |
| | | /** |
| | | * 消息类型 |
| | | */ |
| | | public enum MessageTypeEnum { |
| | | |
| | | PLACEMENT_APPLY("1","您有【{}】条【自主购房安置申请批次】等待审批"), |
| | | PLACEMENT_BATCH("2","您有【{}】条【安置批次】等待审批"), |
| | | PLACEMENT_PAY("3","本月应支付补偿款合计为【{}】"), |
| | | PLACEMENT_FIRST_PAY("4","您有【{}】户自主购房安置人员需要支付首付款"), |
| | | PLACEMENT_MONTH_PAY("5","您有一笔季度款即将支付,支付金额为【{}万元】") |
| | | |
| | | |
| | | ; |
| | | |
| | | |
| | | private final String code; |
| | | private final String message; |
| | | |
| | | MessageTypeEnum(String code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.enums; |
| | | |
| | | |
| | | import com.ruoyi.bussiness.object.response.placement.PlacementTemplateResponse; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyTemplateResponse; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementAssetTemplateResponse; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementHouseholdTemplateResponse; |
| | | |
| | | /** |
| | | * 模板文件类型 enum |
| | | * 为了方便引入所以放在这个包里面 |
| | | */ |
| | | public enum TemplateFileTypeEnum { |
| | | |
| | | FILE_1(1, PlacementTemplateResponse.class, "待安置人员库导入模板.xlsx"), |
| | | FILE_2(2, PlacementApplyTemplateResponse.class, "自主购房安置申请导入模板.xlsx"), |
| | | FILE_3(3, PlacementAssetTemplateResponse.class,"安置批次-资金表导入模版.xlsx"), |
| | | FILE_4(4, PlacementHouseholdTemplateResponse.class,"安置批次-购房表导入模版.xlsx"), |
| | | |
| | | ; |
| | | |
| | | |
| | | private final Integer fileType; |
| | | private final Class<?> clazz; |
| | | private final String fileName; |
| | | |
| | | TemplateFileTypeEnum(Integer fileType, Class<?> clazz, String fileName) { |
| | | this.fileType = fileType; |
| | | this.clazz = clazz; |
| | | this.fileName = fileName; |
| | | } |
| | | |
| | | public Integer getFileType() { |
| | | return fileType; |
| | | } |
| | | |
| | | public Class<?> getClazz() { |
| | | return clazz; |
| | | } |
| | | |
| | | public String getFileName() { |
| | | return fileName; |
| | | } |
| | | |
| | | public static Class<?> getClazzByFileType(Integer fileType) { |
| | | for (TemplateFileTypeEnum file : TemplateFileTypeEnum.values()) { |
| | | if (file.getFileType().equals(fileType)) { |
| | | return file.getClazz(); |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("Invalid file name: " + fileType); |
| | | } |
| | | |
| | | public static TemplateFileTypeEnum getEnumByFileType(Integer fileType) { |
| | | for (TemplateFileTypeEnum file : TemplateFileTypeEnum.values()) { |
| | | if (file.getFileType().equals(fileType)) { |
| | | return file; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("Invalid file name: " + fileType); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.Compensate; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface CompensateMapper extends BaseMapper<Compensate> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.DataFile; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface DataFileMapper extends BaseMapper<DataFile> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.DataFile; |
| | | import com.ruoyi.bussiness.domain.PlacementApply; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface PlacementApplyMapper extends BaseMapper<PlacementApply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import com.ruoyi.bussiness.object.response.screen.ScreenResponse; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface PlacementApplyRecordMapper extends BaseMapper<PlacementApplyRecord> { |
| | | |
| | | |
| | | /** |
| | | * 大屏-统计 |
| | | * @param month |
| | | * @param lastMonth |
| | | * @param nextMonth |
| | | * @return |
| | | */ |
| | | ScreenResponse queryMainData(@Param("month") String month, |
| | | @Param("lastMonth") String lastMonth, |
| | | @Param("nextMonth") String nextMonth); |
| | | |
| | | |
| | | Integer countPassIdCard(@Param("idCard") String idCard); |
| | | |
| | | |
| | | |
| | | List<PlacementApplyRecord> getRecordsByCardIds(@Param("idCards") List<String> idCards); |
| | | |
| | | |
| | | List<Map<String,Object>> countError(@Param("applyId") Long applyId); |
| | | |
| | | |
| | | PlacementApplyRecord getRecordsByCardId(@Param("idCard") String idCard); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface PlacementBatchAssetMapper extends BaseMapper<PlacementBatchAsset> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.GetHouseHistoryRequest; |
| | | import com.ruoyi.bussiness.object.response.report.DetailResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportSumResponse; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface PlacementBatchHouseholdMapper extends BaseMapper<PlacementBatchHousehold> { |
| | | |
| | | /** |
| | | * 汇总 |
| | | * |
| | | * @param street |
| | | * @return |
| | | */ |
| | | ReportSumResponse reportPlacementHouseholdSum(@Param("street") String street); |
| | | |
| | | |
| | | /** |
| | | * 分页统计 |
| | | * @param page |
| | | * @param request |
| | | * @return |
| | | */ |
| | | Page<Map<String,Object>> reportPage(IPage<Map<String,Object>> page, @Param("request") ReportPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> reportExportsList(@Param("request") DetailExportsRequest request); |
| | | |
| | | /** |
| | | * 详情分页 |
| | | * @param page |
| | | * @param request |
| | | * @return |
| | | */ |
| | | Page<DetailResponse> detailPage(IPage<DetailResponse> page, @Param("request") DetailPageRequest request); |
| | | |
| | | |
| | | |
| | | //统计 |
| | | BigDecimal sumCurrentMonth(@Param("month") String month); |
| | | |
| | | |
| | | //统计 |
| | | BigDecimal countCurrentPerson(); |
| | | |
| | | //街镇参与人数统计(审核通过) |
| | | List<StreetResponse> getStreetResponse(); |
| | | |
| | | //错误数据统计 |
| | | List<ImportErrorResponse> getImportErrorResponse(); |
| | | |
| | | //地图数据统计 |
| | | List<MapResponse> getMapResponse(); |
| | | |
| | | //季度款进度 |
| | | List<QuarterProcessResponse> getQuarterProcessResponse(@Param("request") ReportRequest request); |
| | | |
| | | //房屋类型占比 |
| | | List<PlacementTypeResponse> getPlacementTypeResponse(); |
| | | |
| | | //本月补偿金额统计 |
| | | List<MonthCompensationResponse> getMonthCompensationResponse(@Param("month") String month); |
| | | |
| | | //未来4季度支付款项金额 |
| | | List<Map<String, Object>> getQuarterPayResponse(@Param("quarters") List<String> quarters); |
| | | |
| | | //某季度应支付 |
| | | BigDecimal getPayMoneyByQuarter(@Param("quarter") String quarter); |
| | | |
| | | |
| | | List<PlacementBatchHousehold> getPlacementByIdCards(@Param("idCards") List<String> idCards); |
| | | |
| | | |
| | | List<PlacementBatchHousehold> getHouseHistory(@Param("request") GetHouseHistoryRequest request); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface PlacementBatchMapper extends BaseMapper<PlacementBatch> { |
| | | |
| | | List<Map<String, Object>> countError(@Param("batchId") Long batchId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.bussiness.domain.PlacementError; |
| | | import com.ruoyi.bussiness.object.request.error.ErrorPageRequest; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface PlacementErrorMapper extends BaseMapper<PlacementError> { |
| | | |
| | | IPage<PlacementError> page(Page<PlacementError> page,@Param("request") ErrorPageRequest request); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface PlacementMapper extends BaseMapper<Placement> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.dataFile; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | public class FileAddRequest { |
| | | |
| | | @NotBlank(message = "街道不能为空") |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @NotBlank(message = "名称不能为空") |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "附件名称") |
| | | private String attachName; |
| | | |
| | | @ApiModelProperty(value = "附件") |
| | | private String attachUrl; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.dataFile; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class FileDelRequest { |
| | | |
| | | |
| | | @NotNull(message = "id不能为空") |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.dataFile; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class FileUpdateRequest { |
| | | |
| | | |
| | | @NotNull(message = "id不能为空") |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @NotBlank(message = "街道不能为空") |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @NotBlank(message = "名称不能为空") |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "附件名称") |
| | | private String attachName; |
| | | |
| | | @ApiModelProperty(value = "附件") |
| | | private String attachUrl; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.dataFile; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ListRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "资料名称") |
| | | private String name; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.error; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ErrorPageRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placement; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementIdRequest { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placement; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Data |
| | | public class PlacementImportRequest { |
| | | |
| | | private MultipartFile file; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placement; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementPageRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主名称或者身份证") |
| | | private String headOrIdCard; |
| | | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "家庭成员") |
| | | private String familyNames; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class ApplyAllExportRequest { |
| | | |
| | | @NotNull(message = "申请表id不能为空") |
| | | @ApiModelProperty(value = "申请表id") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "街区") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主或者身份证") |
| | | private String headOrIdCard; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class ApplyProblemExportRequest { |
| | | |
| | | @NotNull(message = "申请表id不能为空") |
| | | @ApiModelProperty(value = "申请表id") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "街区") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主或者身份证") |
| | | private String headOrIdCard; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class PlacementApplyApproveRequest { |
| | | |
| | | @NotNull(message = "申请Id不能为空") |
| | | @ApiModelProperty(value = "申请Id") |
| | | private Long applyId; |
| | | |
| | | @NotNull(message = "审核状态不能为空") |
| | | @ApiModelProperty(value = "状态(1通过 2驳回)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | private String reason; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class PlacementApplyIdRequest { |
| | | |
| | | @NotNull(message = "申请id不能为空") |
| | | @ApiModelProperty(value = "applyId") |
| | | private Long id; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementApplyPageRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "状态(0待审核 1审核通过 2驳回)") |
| | | private String status; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class PlacementApplyRecordPageRequest extends PageDomain { |
| | | |
| | | @NotNull(message = "申请表id不能为空") |
| | | @ApiModelProperty(value = "申请表id") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "村") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主或者身份证") |
| | | private String headOrIdCard; |
| | | |
| | | @ApiModelProperty(value = "家庭成员") |
| | | private String familyNames; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Data |
| | | public class PlacementImportsRequest { |
| | | |
| | | @ApiModelProperty(value = "申请表id(最外面的导入不传,详情里面的导入需要传)") |
| | | private String applyId; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "文件") |
| | | private MultipartFile file; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | |
| | | @Data |
| | | public class ApproveRequest { |
| | | |
| | | @NotNull(message = "记录id不能为空") |
| | | @ApiModelProperty(value = "记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "1通过 2驳回") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "原因") |
| | | private String reason; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | |
| | | @Data |
| | | public class IdRequest { |
| | | |
| | | @NotNull(message = "记录id不能为空") |
| | | @ApiModelProperty(value = "记录id") |
| | | private Long id; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class PlacementBatchDetailRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "安置批次id") |
| | | private Long placementBatchId; |
| | | |
| | | @NotNull(message = "类型不能为空") |
| | | @ApiModelProperty(value = "类型 1资金表详情 2购房信息详情") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "社区") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "家庭成员") |
| | | private String familyNames; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementBatchIdRequest { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Data |
| | | public class PlacementBatchImportRequest { |
| | | |
| | | @ApiModelProperty(value = "安置批次表Id(汇总表导入不传,详情表传需要带Id)") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "批次号(目前自动生成)") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "资金表") |
| | | private MultipartFile assetFile; |
| | | |
| | | @ApiModelProperty(value = "购房表") |
| | | private MultipartFile householdFile; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementBatchPageRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "审核状态") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.placementBatch; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class ProblemExportRequest { |
| | | |
| | | @NotNull(message = "类型 1资金表详情 2购房信息详情") |
| | | @ApiModelProperty(value = "类型 1资金表详情 2购房信息详情") |
| | | private Integer type; |
| | | |
| | | @NotNull(message = "安置审批id不能为空") |
| | | @ApiModelProperty(value = "安置审批id") |
| | | private Long placementBatchId; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "街区(社区)") |
| | | private String community; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.report; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DetailExportsRequest { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private List<String> quarters; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.report; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | public class DetailPageRequest extends PageDomain { |
| | | |
| | | @NotBlank(message = "街道不能为空") |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "社区") |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "户主") |
| | | private String householdHead; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.report; |
| | | |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ReportPageRequest extends PageDomain { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(hidden = true,value = "季度") |
| | | private List<String> quarters; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.request.report; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | @Data |
| | | public class ReportRequest { |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String houseHead; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.dataFile; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class DataFileResponse { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "文件名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "附件名称") |
| | | private String attachName; |
| | | |
| | | @ApiModelProperty(value = "附件链接") |
| | | private String attachUrl; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "更新时间") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.dataFile; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ListResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "记录") |
| | | private List<DataFileResponse> records; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.error; |
| | | |
| | | import com.ruoyi.bussiness.domain.PlacementError; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ErrorPageResponse { |
| | | |
| | | private long total; |
| | | |
| | | private List<PlacementError> records; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placement; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class GetHouseHistoryRequest { |
| | | |
| | | @ApiModelProperty(value = "家庭成员姓名") |
| | | private String familyName; |
| | | |
| | | @ApiModelProperty(value = "家庭成员身份证") |
| | | private String familyIdCard; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placement; |
| | | |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PlacementPageResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "记录") |
| | | private List<Placement> records; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.object.response.placement; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PlacementTemplateResponse { |
| | | |
| | | @ExcelProperty(value = "项目名称", index = 0, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | // @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ExcelProperty(value = "项目启动时间", index = 1, converter = DateConverter.class) |
| | | @ApiModelProperty(value = "启动时间") |
| | | private Date startTime; |
| | | |
| | | @ExcelProperty(value = "镇街", index = 2, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ExcelProperty(value = "村社区", index = 3, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "社区") |
| | | private String community; |
| | | |
| | | @ExcelProperty(value = "组", index = 4, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "组") |
| | | private String groupName; |
| | | |
| | | @ExcelProperty(value = "户主姓名", index = 5, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ExcelProperty(value = "身份证号码", index = 6, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号码") |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "家庭成员名字", index = 7, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "家庭成员名称") |
| | | private String familyName; |
| | | |
| | | @ExcelProperty(value = "关系", index = 8, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "关系") |
| | | private String relation; |
| | | |
| | | @ExcelProperty(value = "人员性质", index = 9, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "人员类型") |
| | | private String personType; |
| | | |
| | | @ExcelProperty(value = "身份证号码", index = 10, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号码") |
| | | private String familyIdCard; |
| | | |
| | | @ExcelProperty(value = "年龄", index = 11, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | |
| | | @ExcelProperty(value = "性别", index = 12, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ExcelProperty(value = "出生年月日", index = 13, converter = DateConverter.class) |
| | | private Date birthday; |
| | | |
| | | @ExcelProperty(value = "安置方式", index = 14, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "安置方式") |
| | | private String ways; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ExcelProperty(value = "原始拆迁时领取过度费时间", index = 15, converter = DateConverter.class) |
| | | @ApiModelProperty(value = "原始拆迁时领取过度费时间") |
| | | private Date originCollectionTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ExcelProperty(value = "上次过度费发放时间(起)", index = 16, converter = DateConverter.class) |
| | | @ApiModelProperty(value = "上次过度费发放时间(起)") |
| | | private Date lastBeginTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ExcelProperty(value = "上次过度费发放时间(止)", index = 17, converter = DateConverter.class) |
| | | @ApiModelProperty(value = "上次过度费发放时间(止)") |
| | | private Date lastEndTime; |
| | | |
| | | @ExcelProperty(value = "剩余未安置面积(平方米)", index = 18, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "剩余未安置面积") |
| | | private BigDecimal noHouseArea; |
| | | |
| | | @ExcelProperty(value = "剩余未安置商铺面积(平方米)", index = 19, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "剩余未安置商铺面积") |
| | | private BigDecimal noShopArea; |
| | | |
| | | @ExcelProperty(value = "联系方式", index = 20, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String mobile; |
| | | |
| | | @ExcelProperty(value = "备注", index = 21, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | public static PlacementTemplateResponse generateExampleData() { |
| | | PlacementTemplateResponse exampleData = new PlacementTemplateResponse(); |
| | | exampleData.setProjectName("示例项目1"); |
| | | exampleData.setStartTime(new Date()); |
| | | exampleData.setStreet("示例街道1"); |
| | | exampleData.setCommunity("示例社区1"); |
| | | exampleData.setGroupName("示例组1"); |
| | | exampleData.setHouseholdHead("示例外户主1"); |
| | | exampleData.setFamilyName("示例外家庭成员1"); |
| | | exampleData.setFamilyIdCard("123456789012345678"); |
| | | exampleData.setRelation("示例外关系1"); |
| | | exampleData.setPersonType("示例外人员类型1"); |
| | | exampleData.setIdCard("123456789012345678"); |
| | | exampleData.setAge(30); |
| | | exampleData.setSex("男"); |
| | | exampleData.setBirthday(new Date()); |
| | | exampleData.setWays("示例外安置方式1"); |
| | | exampleData.setOriginCollectionTime(new Date()); |
| | | exampleData.setMobile("13800138000"); |
| | | exampleData.setLastBeginTime(new Date()); |
| | | exampleData.setLastEndTime(new Date()); |
| | | exampleData.setNoHouseArea(new BigDecimal("100.50")); |
| | | exampleData.setNoShopArea(new BigDecimal("50.25")); |
| | | exampleData.setRemark("示例外备注1"); |
| | | return exampleData; |
| | | } |
| | | |
| | | public static MultiDropdownWriteHandler generateHeaderData(List<SysDictData> street, List<SysDictData> relation) { |
| | | Map<Integer, String[]> dropdownOptionsMap = new HashMap<>(); |
| | | dropdownOptionsMap.put(2, street.stream() |
| | | .map(SysDictData::getDictLabel) |
| | | .toArray(String[]::new)); |
| | | dropdownOptionsMap.put(8, relation.stream() |
| | | .map(SysDictData::getDictLabel) |
| | | .toArray(String[]::new)); |
| | | dropdownOptionsMap.put(12, new String[]{"男", "女"}); |
| | | return new MultiDropdownWriteHandler(dropdownOptionsMap); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementApply; |
| | | |
| | | import com.ruoyi.bussiness.domain.PlacementApply; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | public class PlacementApplyPageResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "分页数据") |
| | | private List<PlacementApply> records; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementApply; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PlacementApplyRecordIdRequest { |
| | | |
| | | @ApiModelProperty(value = "自主购房安置申请表-记录id") |
| | | private Long id; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementApply; |
| | | |
| | | import com.ruoyi.bussiness.domain.PlacementApply; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PlacementApplyRecordPageResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "汇总表") |
| | | private PlacementApply placementApply; |
| | | |
| | | @ApiModelProperty(value = "总记录") |
| | | private List<PlacementApplyRecord> records; |
| | | |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.object.response.placementApply; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.swing.*; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PlacementApplyTemplateResponse { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | @ExcelProperty(value = "拆迁时间", index = 3, converter = DateConverter.class) |
| | | private Date demolitionTime; |
| | | |
| | | @ApiModelProperty(value = "户主姓名") |
| | | @ExcelProperty(value = "户主姓名", index = 4, converter = StringConverter.class) |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | @ExcelProperty(value = "身份证号", index = 5, converter = StringConverter.class) |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @ExcelProperty(value = "联系电话", index = 6, converter = StringConverter.class) |
| | | private String mobile; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-集体经济组织成员") |
| | | @ExcelProperty(value = {"本次安置人数(人)","集体经济组织成员"}, index = 7, converter = NumberConverter.class) |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-非集体经济组织成员") |
| | | @ExcelProperty(value = {"本次安置人数(人)","非集体经济组织成员"}, index = 8, converter = NumberConverter.class) |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-合计") |
| | | @ExcelProperty(value = {"本次安置人数(人)","合计"}, index = 9, converter = NumberConverter.class) |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员姓名") |
| | | @ExcelProperty(value = "待安置家庭成员姓名", index = 10, converter = StringConverter.class) |
| | | private String waitFamilyNames; |
| | | |
| | | @ExcelProperty(value = "集体面积", index = 11, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "集体面积") |
| | | private BigDecimal orgArea; |
| | | |
| | | @ExcelProperty(value = "非集体面积", index = 12, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "非集体面积") |
| | | private BigDecimal noOrgArea; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计(m²)") |
| | | @ExcelProperty(value = "待安置人员应安置面积合计(m²)", index = 13, converter = BigDecimalConverter.class) |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(万元)-新建商品住房、商业用房、停车位") |
| | | @ExcelProperty(value = {"补偿金额(万元)","新建商品住房、商业用房、停车位"}, index = 14, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(万元)-二手住房") |
| | | @ExcelProperty(value = {"补偿金额(万元)","二手住房"}, index = 15, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | @ExcelProperty(value = {"补偿金额(万元)","合计"}, index = 16, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 17, converter = BigDecimalConverter.class) |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 18, converter = BigDecimalConverter.class) |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | @ExcelProperty(value = "过渡补贴(万元)", index = 19, converter = BigDecimalConverter.class) |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelProperty(value = "备注", index = 20, converter = StringConverter.class) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "购房差异情况") |
| | | @ExcelProperty(value = "购房差异情况", index = 21, converter = StringConverter.class) |
| | | private String situation; |
| | | |
| | | |
| | | |
| | | public static PlacementApplyTemplateResponse generateExampleData() { |
| | | PlacementApplyTemplateResponse exampleData = new PlacementApplyTemplateResponse(); |
| | | exampleData.setProjectName("示例项目"); |
| | | exampleData.setStreet("示例街道"); |
| | | exampleData.setCommunity("示例社区"); |
| | | exampleData.setDemolitionTime(new Date()); |
| | | exampleData.setHouseholdHead("示例外户主"); |
| | | exampleData.setIdCard("123456789012345678"); |
| | | exampleData.setMobile("13800138000"); |
| | | exampleData.setCurrentCollectiveNum(1); |
| | | exampleData.setCurrentNoCollectiveNum(0); |
| | | exampleData.setCurrentCount(1); |
| | | exampleData.setWaitFamilyNames("示例外家庭成员"); |
| | | exampleData.setWaitFamilyArea(new BigDecimal("100.50")); |
| | | exampleData.setCompensationNewAmount(new BigDecimal("500.00")); |
| | | exampleData.setCompensationOldAmount(new BigDecimal("300.00")); |
| | | exampleData.setCompensationSum(new BigDecimal("800.00")); |
| | | exampleData.setDownPaymentAmount(new BigDecimal("200.00")); |
| | | exampleData.setQuarterPayAmount(new BigDecimal("50.00")); |
| | | exampleData.setSubsidyAmount(new BigDecimal("100.00")); |
| | | exampleData.setRemark("示例外备注"); |
| | | exampleData.setSituation("示例外购房差异情况"); |
| | | exampleData.setOrgArea(BigDecimal.ZERO); |
| | | exampleData.setNoOrgArea(BigDecimal.ZERO); |
| | | return exampleData; |
| | | } |
| | | |
| | | public static MultiDropdownWriteHandler generateHeaderData(List<SysDictData> street) { |
| | | Map<Integer, String[]> dropdownOptionsMap = new HashMap<>(); |
| | | dropdownOptionsMap.put(0, street.stream() |
| | | .map(SysDictData::getDictLabel) |
| | | .toArray(String[]::new)); |
| | | return new MultiDropdownWriteHandler(dropdownOptionsMap); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementApply; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.easyExcel.BigDecimalConverter; |
| | | import com.ruoyi.common.easyExcel.DateConverter; |
| | | import com.ruoyi.common.easyExcel.NumberConverter; |
| | | import com.ruoyi.common.easyExcel.StringConverter; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ProblemExportResponse { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | private String community; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | @ExcelProperty(value = "拆迁时间", index = 3, converter = DateConverter.class) |
| | | private Date demolitionTime; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | @ExcelProperty(value = "户主姓名", index = 4, converter = StringConverter.class) |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | @ExcelProperty(value = "身份证号", index = 5, converter = StringConverter.class) |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @ExcelProperty(value = "联系电话", index = 6, converter = StringConverter.class) |
| | | private String mobile; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-集体经济组织成员") |
| | | @ExcelProperty(value = {"本次安置人数(人)","集体经济组织成员"}, index = 7, converter = NumberConverter.class) |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-非集体经济组织成员") |
| | | @ExcelProperty(value = {"本次安置人数(人)","非集体经济组织成员"}, index = 8, converter = NumberConverter.class) |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数(人)-合计") |
| | | @ExcelProperty(value = {"本次安置人数(人)","合计"}, index = 9, converter = NumberConverter.class) |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员姓名") |
| | | @ExcelProperty(value = "待安置家庭成员姓名", index = 10, converter = StringConverter.class) |
| | | private String waitFamilyNames; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计(m²)") |
| | | @ExcelProperty(value = "待安置人员应安置面积合计(m²)", index = 11, converter = BigDecimalConverter.class) |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(万元)-新建商品住房、商业用房、停车位") |
| | | @ExcelProperty(value = {"补偿金额(万元)","新建商品住房、商业用房、停车位"}, index = 12, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(万元)-二手住房") |
| | | @ExcelProperty(value = {"补偿金额(万元)","二手住房"}, index = 13, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | @ExcelProperty(value = {"补偿金额(万元)","合计"}, index = 14, converter = BigDecimalConverter.class) |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 15, converter = BigDecimalConverter.class) |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 16, converter = BigDecimalConverter.class) |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | @ExcelProperty(value = "过渡补贴(万元)", index = 17, converter = BigDecimalConverter.class) |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelProperty(value = "备注", index = 18, converter = StringConverter.class) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "购房差异情况") |
| | | @ExcelProperty(value = "购房差异情况", index = 19, converter = StringConverter.class) |
| | | private String situation; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.easyExcel.BigDecimalConverter; |
| | | import com.ruoyi.common.easyExcel.DateConverter; |
| | | import com.ruoyi.common.easyExcel.NumberConverter; |
| | | import com.ruoyi.common.easyExcel.StringConverter; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class AssetExportResponse { |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "镇(街道)") |
| | | private String street; |
| | | |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @ExcelProperty(value = "户主姓名", index = 3, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 4, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "应安置人数(人)", index = 5, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "应安置人数(人)") |
| | | private Integer resettledNum; |
| | | |
| | | @ExcelProperty(value = "所有家庭人员应安置面积(m²)", index = 6, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "所有家庭人员应安置面积(m²)") |
| | | private BigDecimal resettledArea; |
| | | |
| | | @ExcelProperty(value = {"补偿单价标准", "新建商品房、商业用房、停车位"}, index = 7, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿单价标准-新建商品房、商业用房、停车位") |
| | | private BigDecimal priceNewAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿单价标准", "二手住房"}, index = 8, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿单价标准-二手住房") |
| | | private BigDecimal priceOldAmount; |
| | | |
| | | @ExcelProperty(value = "补偿总价(万元)", index = 9, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿总价(万元)") |
| | | private BigDecimal compensationAmount; |
| | | |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 10, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 11, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ExcelProperty(value = "过渡补贴(万元)", index = 12, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.easyExcel.BigDecimalConverter; |
| | | import com.ruoyi.common.easyExcel.DateConverter; |
| | | import com.ruoyi.common.easyExcel.NumberConverter; |
| | | import com.ruoyi.common.easyExcel.StringConverter; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HouseholdExportResponse { |
| | | |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @ExcelProperty(value = "拆迁时间", index = 3, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | private Date demolitionTime; |
| | | |
| | | @ExcelProperty(value = "户主姓名", index = 4, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 5, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 6, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String mobile; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数(人)", "集体经济组织成员"}, index = 7, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 集体经济组织成员") |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数(人)", "非集体经济组织成员"}, index = 8, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 非集体经济组织成员") |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数", "合计"}, index = 9, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 合计") |
| | | private Integer currentCount; |
| | | |
| | | @ExcelProperty(value = "待安置家庭成员姓名", index = 10, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "待安置家庭成员姓名") |
| | | private String waitFamilyNames; |
| | | |
| | | @ExcelProperty(value = "待安置人员应安置面积合计(m²)", index = 11, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计(m²)") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "新建商品住房、商业用房、停车位"}, index = 12, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额 - 新建商品住房、商业用房、停车位") |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "二手住房"}, index = 13, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额 - 二手住房") |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "合计"}, index = 14, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 15, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 16, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ExcelProperty(value = "过渡补贴", index = 17, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ExcelProperty(value = "备注", index = 18, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "凭证发放时间", index = 19, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "凭证发放时间") |
| | | private Date certificateTime; |
| | | |
| | | @ExcelProperty(value = "购房时间", index = 20, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "购房时间") |
| | | private Date buyTime; |
| | | |
| | | @ExcelProperty(value = "成交金额", index = 21, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "成交金额") |
| | | private BigDecimal dealAmount; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "楼盘名称"}, index = 22, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 楼盘名称") |
| | | private String newHousingName; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "面积(m²)"}, index = 23, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 面积(m²)") |
| | | private BigDecimal newHousingArea; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "套数(套)"}, index = 24, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 套数(套)") |
| | | private Integer newHousingNum; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "小区名称"}, index = 25, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 小区名称") |
| | | private String oldHousingName; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "面积(m²)"}, index = 26, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 面积(m²)") |
| | | private BigDecimal oldHousingArea; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "套数(套)"}, index = 27, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 套数(套)") |
| | | private Integer oldHousingNum; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "楼盘名称"}, index = 28, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 楼盘名称") |
| | | private String buildHousingName; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "面积(m²)"}, index = 29, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 面积(m²)") |
| | | private BigDecimal buildHousingArea; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "套数(套)"}, index = 30, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 套数(套)") |
| | | private Integer buildHousingNum; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "楼盘名称"}, index = 31, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建停车位 - 楼盘名称") |
| | | private String newStopName; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "金额(万元)"}, index = 32, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建停车位 - 金额(万元)") |
| | | private BigDecimal newStopArea; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "个数"}, index = 33, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建停车位个数") |
| | | private Integer newStopNum; |
| | | |
| | | @ExcelProperty(value = "自主购房签订时间", index = 34, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "自主购房签订时间") |
| | | private Date signTime; |
| | | |
| | | @ExcelProperty(value = "25%补偿款及过渡补贴支付时间", index = 35, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "25%补偿款及过渡补贴支付时间") |
| | | private Date compensationPayTime; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第一年"}, index = 36, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第一年") |
| | | private Date remainingTime1; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第二年"}, index = 37, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第二年") |
| | | private Date remainingTime2; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第三年"}, index = 38, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第三年") |
| | | private Date remainingTime3; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第四年"}, index = 39, converter = DateConverter.class) |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第四年") |
| | | private Date remainingTime4; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第五年"}, index = 40, converter = DateConverter.class) |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第五年") |
| | | private Date remainingTime5; |
| | | |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PlacementAssetTemplateResponse { |
| | | |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "镇(街道)") |
| | | private String street; |
| | | |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @ExcelProperty(value = "户主姓名", index = 3, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 4, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "应安置人数(人)", index = 5, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "应安置人数(人)") |
| | | private Integer resettledNum; |
| | | |
| | | @ExcelProperty(value = "所有家庭人员应安置面积(m²)", index = 6, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "所有家庭人员应安置面积(m²)") |
| | | private BigDecimal resettledArea; |
| | | |
| | | @ExcelProperty(value = {"补偿单价标准", "新建商品房、商业用房、停车位"}, index = 7, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿单价标准-新建商品房、商业用房、停车位") |
| | | private BigDecimal priceNewAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿单价标准", "二手住房"}, index = 8, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿单价标准-二手住房") |
| | | private BigDecimal priceOldAmount; |
| | | |
| | | @ExcelProperty(value = "补偿总价(万元)", index = 9, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿总价(万元)") |
| | | private BigDecimal compensationAmount; |
| | | |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 10, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 11, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ExcelProperty(value = "过渡补贴(万元)", index = 12, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "过渡补贴(万元)") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | public static PlacementAssetTemplateResponse generateExampleData() { |
| | | PlacementAssetTemplateResponse exampleData = new PlacementAssetTemplateResponse(); |
| | | exampleData.setStreet("镇A"); |
| | | exampleData.setProjectName("项目B"); |
| | | exampleData.setCommunity("社区C"); |
| | | exampleData.setHouseholdHead("张三"); |
| | | exampleData.setIdCard("123456789012345678"); |
| | | exampleData.setResettledNum(3); |
| | | exampleData.setResettledArea(new BigDecimal("120.5")); |
| | | exampleData.setPriceNewAmount(new BigDecimal("20000")); |
| | | exampleData.setPriceOldAmount(new BigDecimal("15000")); |
| | | exampleData.setCompensationAmount(new BigDecimal("330.75")); |
| | | exampleData.setDownPaymentAmount(new BigDecimal("82.6875")); |
| | | exampleData.setQuarterPayAmount(new BigDecimal("25")); |
| | | exampleData.setSubsidyAmount(new BigDecimal("10")); |
| | | return exampleData; |
| | | } |
| | | |
| | | public static MultiDropdownWriteHandler generateHeaderData(List<SysDictData> street) { |
| | | Map<Integer, String[]> dropdownOptionsMap = new HashMap<>(); |
| | | dropdownOptionsMap.put(0, street.stream() |
| | | .map(SysDictData::getDictLabel) |
| | | .toArray(String[]::new)); |
| | | return new MultiDropdownWriteHandler(dropdownOptionsMap); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PlacementBatchDetailResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "汇总信息") |
| | | private PlacementBatch placementBatch; |
| | | |
| | | @ApiModelProperty(value = "资金记录") |
| | | private List<PlacementBatchAsset> assetList; |
| | | |
| | | @ApiModelProperty(value = "购房记录") |
| | | private List<PlacementBatchHousehold> householdList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PlacementBatchPageResponse { |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(value = "分页数据") |
| | | private List<PlacementBatch> records; |
| | | |
| | | } |
New file |
| | |
| | | |
| | | package com.ruoyi.bussiness.object.response.placementBatch; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.easyExcel.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PlacementHouseholdTemplateResponse { |
| | | |
| | | @ExcelProperty(value = "镇(街道)", index = 0, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ExcelProperty(value = "拆迁项目名称", index = 1, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "拆迁项目名称") |
| | | private String projectName; |
| | | |
| | | @ExcelProperty(value = "所在村(社区)", index = 2, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @ExcelProperty(value = "拆迁时间", index = 3, converter = DateConverter.class) |
| | | @DateTimeFormat(pattern = "yyyy/MM/dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | private Date demolitionTime; |
| | | |
| | | @ExcelProperty(value = "户主姓名", index = 4, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "户主姓名") |
| | | private String householdHead; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 5, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 6, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String mobile; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数(人)", "集体经济组织成员"}, index = 7, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 集体经济组织成员") |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数(人)", "非集体经济组织成员"}, index = 8, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 非集体经济组织成员") |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ExcelProperty(value = {"本次安置人数", "合计"}, index = 9, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "本次安置人数 - 合计") |
| | | private Integer currentCount; |
| | | |
| | | @ExcelProperty(value = "待安置家庭成员姓名", index = 10, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "待安置家庭成员姓名") |
| | | private String waitFamilyNames; |
| | | |
| | | @ExcelProperty(value = "待安置人员应安置面积合计(m²)", index = 11, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计(m²)") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "新建商品住房、商业用房、停车位"}, index = 12, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额 - 新建商品住房、商业用房、停车位") |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "二手住房"}, index = 13, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额 - 二手住房") |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ExcelProperty(value = {"补偿金额(万元)", "合计"}, index = 14, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ExcelProperty(value = "25%首付款(万元)", index = 15, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ExcelProperty(value = "每季度需支付款项(万元)", index = 16, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ExcelProperty(value = "过渡补贴", index = 17, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ExcelProperty(value = "备注", index = 18, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "凭证发放时间", index = 19, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "凭证发放时间") |
| | | private Date certificateTime; |
| | | |
| | | @ExcelProperty(value = "购房时间", index = 20, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "购房时间") |
| | | private Date buyTime; |
| | | |
| | | @ExcelProperty(value = "成交金额", index = 21, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "成交金额") |
| | | private BigDecimal dealAmount; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "楼盘名称"}, index = 22, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 楼盘名称") |
| | | private String newHousingName; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "面积(m²)"}, index = 23, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 面积(m²)") |
| | | private BigDecimal newHousingArea; |
| | | |
| | | @ExcelProperty(value = {"新建商品住房", "套数(套)"}, index = 24, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建商品住房 - 套数(套)") |
| | | private Integer newHousingNum; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "小区名称"}, index = 25, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 小区名称") |
| | | private String oldHousingName; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "面积(m²)"}, index = 26, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 面积(m²)") |
| | | private BigDecimal oldHousingArea; |
| | | |
| | | @ExcelProperty(value = {"二手住房", "套数(套)"}, index = 27, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "二手住房 - 套数(套)") |
| | | private Integer oldHousingNum; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "楼盘名称"}, index = 28, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 楼盘名称") |
| | | private String buildHousingName; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "面积(m²)"}, index = 29, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 面积(m²)") |
| | | private BigDecimal buildHousingArea; |
| | | |
| | | @ExcelProperty(value = {"新建商业用房", "套数(套)"}, index = 30, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建商业用房 - 套数(套)") |
| | | private Integer buildHousingNum; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "楼盘名称"}, index = 31, converter = StringConverter.class) |
| | | @ApiModelProperty(value = "新建停车位 - 楼盘名称") |
| | | private String newStopName; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "金额(万元)"}, index = 32, converter = BigDecimalConverter.class) |
| | | @ApiModelProperty(value = "新建停车位 - 金额(万元)") |
| | | private BigDecimal newStopArea; |
| | | |
| | | @ExcelProperty(value = {"新建停车位", "个数"}, index = 33, converter = NumberConverter.class) |
| | | @ApiModelProperty(value = "新建停车位个数") |
| | | private Integer newStopNum; |
| | | |
| | | @ExcelProperty(value = "自主购房签订时间", index = 34, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "自主购房签订时间") |
| | | private Date signTime; |
| | | |
| | | @ExcelProperty(value = "25%补偿款及过渡补贴支付时间", index = 35, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "25%补偿款及过渡补贴支付时间") |
| | | private Date compensationPayTime; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第一年"}, index = 36, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第一年") |
| | | private Date remainingTime1; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第二年"}, index = 37, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第二年") |
| | | private Date remainingTime2; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第三年"}, index = 38, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第三年") |
| | | private Date remainingTime3; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第四年"}, index = 39, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第四年") |
| | | private Date remainingTime4; |
| | | |
| | | @ExcelProperty(value = {"剩余款项支付时间", "第五年"}, index = 40, converter = DateConverter.class) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第五年") |
| | | private Date remainingTime5; |
| | | |
| | | |
| | | public static PlacementHouseholdTemplateResponse generateExampleData() { |
| | | PlacementHouseholdTemplateResponse exampleData = new PlacementHouseholdTemplateResponse(); |
| | | exampleData.setStreet("镇A"); |
| | | exampleData.setProjectName("项目B"); |
| | | exampleData.setCommunity("社区C"); |
| | | exampleData.setDemolitionTime(new Date()); |
| | | exampleData.setHouseholdHead("张三"); |
| | | exampleData.setIdCard("123456789012345678"); |
| | | exampleData.setMobile("13800138000"); |
| | | exampleData.setCurrentCollectiveNum(2); |
| | | exampleData.setCurrentNoCollectiveNum(1); |
| | | exampleData.setCurrentCount(3); |
| | | exampleData.setWaitFamilyNames("李四,王五"); |
| | | exampleData.setWaitFamilyArea(new BigDecimal("100.00")); |
| | | exampleData.setCompensationNewAmount(new BigDecimal("200.00")); |
| | | exampleData.setCompensationOldAmount(new BigDecimal("150.00")); |
| | | exampleData.setCompensationSum(new BigDecimal("350.00")); |
| | | exampleData.setDownPaymentAmount(new BigDecimal("87.50")); |
| | | exampleData.setQuarterPayAmount(new BigDecimal("25.00")); |
| | | exampleData.setSubsidyAmount(new BigDecimal("10.00")); |
| | | exampleData.setRemark("备注信息"); |
| | | exampleData.setCertificateTime(new Date()); |
| | | exampleData.setBuyTime(new Date()); |
| | | exampleData.setDealAmount(new BigDecimal("300.00")); |
| | | exampleData.setNewHousingName("楼盘X"); |
| | | exampleData.setNewHousingArea(new BigDecimal("50.00")); |
| | | exampleData.setNewHousingNum(1); |
| | | exampleData.setOldHousingName("小区Y"); |
| | | exampleData.setOldHousingArea(new BigDecimal("40.00")); |
| | | exampleData.setOldHousingNum(1); |
| | | exampleData.setBuildHousingName("商业用房Z"); |
| | | exampleData.setBuildHousingArea(new BigDecimal("30.00")); |
| | | exampleData.setBuildHousingNum(1); |
| | | exampleData.setNewStopName("停车场W"); |
| | | exampleData.setNewStopArea(new BigDecimal("5.00")); |
| | | exampleData.setNewStopNum(2); |
| | | exampleData.setSignTime(new Date()); |
| | | exampleData.setCompensationPayTime(new Date()); |
| | | exampleData.setRemainingTime1(new Date()); |
| | | exampleData.setRemainingTime2(new Date()); |
| | | exampleData.setRemainingTime3(new Date()); |
| | | exampleData.setRemainingTime4(new Date()); |
| | | exampleData.setRemainingTime5(new Date()); |
| | | return exampleData; |
| | | } |
| | | |
| | | public static MultiDropdownWriteHandler generateHeaderData(List<SysDictData> street) { |
| | | Map<Integer, String[]> dropdownOptionsMap = new HashMap<>(); |
| | | dropdownOptionsMap.put(0, street.stream() |
| | | .map(SysDictData::getDictLabel) |
| | | .toArray(String[]::new)); |
| | | return new MultiDropdownWriteHandler(dropdownOptionsMap); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DetailPageResponse { |
| | | |
| | | @ApiModelProperty(value = "汇总") |
| | | private ReportSumResponse reportSumResponse; |
| | | |
| | | private Long total; |
| | | |
| | | private List<DetailResponse> records; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DetailResponse { |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "安置批次ID") |
| | | private Long placementBatchId; |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "项目名称") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "所在村(社区)") |
| | | private String community; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "拆迁时间") |
| | | private Date demolitionTime; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "身份证警告 0: 不警告, 1: 警告") |
| | | private Integer idCardWarn; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String mobile; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 集体经济组织成员") |
| | | private Integer currentCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 非集体经济组织成员") |
| | | private Integer currentNoCollectiveNum; |
| | | |
| | | @ApiModelProperty(value = "本次安置人数 - 合计") |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "待安置家庭成员") |
| | | private String waitFamilyNames; |
| | | |
| | | @ApiModelProperty(value = "家庭成员(警告)") |
| | | private Integer waitFamilyNamesWarn; |
| | | |
| | | @ApiModelProperty(value = "待安置人员应安置面积合计") |
| | | private BigDecimal waitFamilyArea; |
| | | |
| | | @ApiModelProperty(value = "补偿金额 - 新建商品住房、商业用房、停车位") |
| | | private BigDecimal compensationNewAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额 - 二手住房") |
| | | private BigDecimal compensationOldAmount; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "补偿金额(合计)警告") |
| | | private Integer compensationSumWarn; |
| | | |
| | | @ApiModelProperty(value = "25%首付款(万元)") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "每季度需支付款项(万元)") |
| | | private BigDecimal quarterPayAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "凭证发放时间") |
| | | private Date certificateTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "购房时间") |
| | | private Date buyTime; |
| | | |
| | | @ApiModelProperty(value = "成交金额") |
| | | private BigDecimal dealAmount; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 楼盘名称") |
| | | private String newHousingName; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 价格") |
| | | private BigDecimal newHousingArea; |
| | | |
| | | @ApiModelProperty(value = "新建商品住房 - 套数") |
| | | private Integer newHousingNum; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 小区名称") |
| | | private String oldHousingName; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 面积") |
| | | private BigDecimal oldHousingArea; |
| | | |
| | | @ApiModelProperty(value = "二手住房 - 套数") |
| | | private Integer oldHousingNum; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 名称") |
| | | private String buildHousingName; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 面积") |
| | | private BigDecimal buildHousingArea; |
| | | |
| | | @ApiModelProperty(value = "新建商业住房 - 套数") |
| | | private Integer buildHousingNum; |
| | | |
| | | @ApiModelProperty(value = "新建停车位 - 楼盘名称") |
| | | private String newStopName; |
| | | |
| | | @ApiModelProperty(value = "新建停车位 - 金额(万元)") |
| | | private BigDecimal newStopArea; |
| | | |
| | | @ApiModelProperty(value = "新建停车位个数") |
| | | private Integer newStopNum; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "自主购房签订时间") |
| | | private Date signTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "25%补偿款及过渡补贴支付时间") |
| | | private Date compensationPayTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第一年") |
| | | private Date remainingTime1; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第二年") |
| | | private Date remainingTime2; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第三年") |
| | | private Date remainingTime3; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第四年") |
| | | private Date remainingTime4; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "剩余款项支付时间第五年") |
| | | private Date remainingTime5; |
| | | |
| | | @ApiModelProperty(value = "付款周期") |
| | | private String cycle; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class ReportExportResponse { |
| | | |
| | | private String street; |
| | | private String currentCount; |
| | | private String compensationSum; |
| | | private Map<String,Object> payMap; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class ReportPageResponse { |
| | | |
| | | @ApiModelProperty(value = "总计") |
| | | private ReportSumResponse reportSumResponse; |
| | | |
| | | @ApiModelProperty(value = "总条数") |
| | | private Long total; |
| | | |
| | | @ApiModelProperty(hidden = true,value = "季度") |
| | | private List<String> quarters; |
| | | |
| | | @ApiModelProperty(value = "记录") |
| | | private List<Map<String,Object>> records; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ReportResponse { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "总人数(安置人数)") |
| | | private Integer currentCount; |
| | | |
| | | @ApiModelProperty(value = "补偿总金额") |
| | | private BigDecimal compensationSum; |
| | | |
| | | @ApiModelProperty(value = "首付款") |
| | | private BigDecimal downPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.report; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ReportSumResponse { |
| | | |
| | | @ApiModelProperty(value = "补偿资金总额") |
| | | private BigDecimal compensationSum = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "首付款") |
| | | private BigDecimal downPaymentAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "过渡补贴") |
| | | private BigDecimal subsidyAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "支付季度款") |
| | | private BigDecimal quarterPayAmount = BigDecimal.ZERO; |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ImportErrorResponse { |
| | | |
| | | @ApiModelProperty(value = "月份") |
| | | private String month; |
| | | |
| | | @ApiModelProperty(value = "安置面积异常") |
| | | private Integer areaErrorCount; |
| | | |
| | | @ApiModelProperty(value = "补偿异常异常") |
| | | private Integer moneyErrorCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MapResponse { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "户") |
| | | private Integer householdCount = 0; |
| | | |
| | | @ApiModelProperty(value = "人") |
| | | private Integer personCount = 0; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class MonthCompensationResponse { |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "占比") |
| | | private String amountRate; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class PlacementTypeResponse { |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "面积") |
| | | private BigDecimal area; |
| | | |
| | | @ApiModelProperty(value = "占比") |
| | | private String rate; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class QuarterProcessResponse { |
| | | |
| | | @ApiModelProperty(value = "批次情况") |
| | | private String batchNumber; |
| | | |
| | | @ApiModelProperty(value = "户主名称") |
| | | private String householdHead; |
| | | |
| | | @ApiModelProperty(value = "安置人数") |
| | | private Integer currentCount; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "季度款支付时间(后端计算时间用)") |
| | | private Date compensationPayTime; |
| | | |
| | | @ApiModelProperty(value = "进度/20") |
| | | private Integer process = 0; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class ScreenResponse { |
| | | |
| | | @ApiModelProperty(value = "申请总户数") |
| | | private Integer houseHoldCount; |
| | | |
| | | @ApiModelProperty(value = "本月应补偿金额") |
| | | private BigDecimal monthCompensationAmount; |
| | | |
| | | @ApiModelProperty(value = "上月应补偿金额") |
| | | private BigDecimal lastMonthCompensationAmount; |
| | | |
| | | @ApiModelProperty(value = "本月应补偿金额环比") |
| | | private String monthCompensationAmountRate; |
| | | |
| | | @ApiModelProperty(value = "下月应补偿金额") |
| | | private BigDecimal nextMonthCompensationAmount; |
| | | |
| | | @ApiModelProperty(value = "下月应补偿金额环比") |
| | | private String nextMonthCompensationAmountRate; |
| | | |
| | | @ApiModelProperty(value = "已参与自主购房安置统计") |
| | | private SelfBuyResponse selfBuyResponse; |
| | | |
| | | @ApiModelProperty(value = "各镇/街参与户数排名") |
| | | private List<StreetResponse> streetResponses; |
| | | |
| | | @ApiModelProperty(value = "户主信息导入异常") |
| | | private List<ImportErrorResponse> importErrorResponses; |
| | | |
| | | @ApiModelProperty(value = "地图数据") |
| | | private List<MapResponse> mapResponses; |
| | | |
| | | @ApiModelProperty(value = "季度款支付进度数据") |
| | | private List<QuarterProcessResponse> quarterProcessResponses; |
| | | |
| | | @ApiModelProperty(value = "安置房型占比") |
| | | private List<PlacementTypeResponse> placementTypeResponses; |
| | | |
| | | @ApiModelProperty(value = "本月应补偿占比") |
| | | private List<MonthCompensationResponse> monthCompensationResponses; |
| | | |
| | | @ApiModelProperty(value = "各季度应补偿金额(字段名称根据当前时间变化)") |
| | | private List<Map<String,Object>> quarterPayResponses; |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SelfBuyResponse { |
| | | |
| | | @ApiModelProperty(value = "总参与户数(户)") |
| | | private Integer householdNum = 0; |
| | | |
| | | @ApiModelProperty(value = "总参与人数(人)") |
| | | private Integer personNum = 0; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.object.response.screen; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StreetResponse { |
| | | |
| | | @ApiModelProperty(value = "街道") |
| | | private String street; |
| | | |
| | | @ApiModelProperty(value = "户数") |
| | | private Integer householdNum = 0; |
| | | |
| | | @ApiModelProperty(value = "最近一批次的参与户数") |
| | | private Integer latestBatchHouseholdCount = 0; |
| | | |
| | | @ApiModelProperty(value = "最近第二批次的参与户数") |
| | | private Integer secondLatestBatchHouseholdCount = 0; |
| | | |
| | | @ApiModelProperty(value = "环比") |
| | | private String householdNumRate = "0%"; |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.Compensate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface CompensateService extends IService<Compensate> { |
| | | |
| | | |
| | | /** |
| | | * 修改补偿标准 |
| | | * @param compensates |
| | | */ |
| | | void updateCompensate(List<Compensate> compensates); |
| | | |
| | | |
| | | /** |
| | | * 应安置面积计算 |
| | | * @param currentCollectiveNum |
| | | * @param currentNoCollectiveNum |
| | | * @param time |
| | | * @return |
| | | */ |
| | | boolean compensateSettleAreaCalculate(Date time,Integer currentCollectiveNum, Integer currentNoCollectiveNum,BigDecimal area); |
| | | |
| | | |
| | | /** |
| | | * 应安置面积计算 |
| | | * @param |
| | | * @return |
| | | */ |
| | | boolean compensateSettleAreaCalculate(BigDecimal orgArea, BigDecimal noOrgArea,BigDecimal area); |
| | | |
| | | /** |
| | | * 自主购房补贴 |
| | | * @return |
| | | */ |
| | | boolean compensateBuyCalculate(Date time,String street, |
| | | Integer currentCollectiveNum,Integer currentNoCollectiveNum, |
| | | BigDecimal compensationNewAmount,BigDecimal compensationOldAmount, |
| | | BigDecimal totalAmount); |
| | | |
| | | |
| | | /** |
| | | * 自主购房补贴 |
| | | * @return |
| | | */ |
| | | boolean compensateBuyCalculateV2(Date time, String street, |
| | | BigDecimal orgArea,BigDecimal noOrgArea, |
| | | BigDecimal compensationNewAmount,BigDecimal compensationOldAmount, |
| | | BigDecimal money); |
| | | |
| | | /** |
| | | * 过渡补贴 |
| | | * @param currentCount 安置人数 |
| | | * @return |
| | | */ |
| | | boolean compensateSubsidyCalculate(Integer currentCount,BigDecimal money); |
| | | |
| | | /** |
| | | * 查询配置信息 |
| | | * @param configKey |
| | | * @return |
| | | */ |
| | | Compensate selectCompensateByConfigKey(String configKey); |
| | | |
| | | |
| | | /** |
| | | * 房源告警 |
| | | * @param currentCount |
| | | * @param area |
| | | * @return |
| | | */ |
| | | boolean houseCalculate(Integer currentCount,BigDecimal area); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.DataFile; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileAddRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileDelRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileUpdateRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.ListRequest; |
| | | import com.ruoyi.bussiness.object.response.dataFile.ListResponse; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | public interface DataFileService extends IService<DataFile> { |
| | | |
| | | |
| | | /** |
| | | * 列表 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | ListResponse list(ListRequest request); |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param request |
| | | */ |
| | | void add(FileAddRequest request); |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param request |
| | | */ |
| | | void update(FileUpdateRequest request); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | void del(FileDelRequest request); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import com.ruoyi.bussiness.object.request.placementApply.ApplyAllExportRequest; |
| | | import com.ruoyi.bussiness.object.request.placementApply.PlacementApplyRecordPageRequest; |
| | | import com.ruoyi.bussiness.object.request.placementApply.ApplyProblemExportRequest; |
| | | import com.ruoyi.bussiness.object.response.screen.ScreenResponse; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PlacementApplyRecordService extends IService<PlacementApplyRecord> { |
| | | |
| | | |
| | | /** |
| | | * 根据申请表id查询明细记录 |
| | | * |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | Page<PlacementApplyRecord> detail(PlacementApplyRecordPageRequest applyId); |
| | | |
| | | /** |
| | | * 根据申请表id查询问题数据记录 |
| | | * |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | List<PlacementApplyRecord> problemList(ApplyProblemExportRequest applyId); |
| | | |
| | | |
| | | /** |
| | | * 根据申请表id查询问题数据记录(神恶化通过) |
| | | * |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | List<PlacementApplyRecord> passList(ApplyAllExportRequest applyId); |
| | | |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | | * @param applyId |
| | | * @return |
| | | */ |
| | | List<PlacementApplyRecord> allData(Long applyId); |
| | | |
| | | |
| | | /** |
| | | * 统计 |
| | | * @param month |
| | | * @param lastMonth |
| | | * @param nextMonth |
| | | * @return |
| | | */ |
| | | ScreenResponse queryMainData(String month,String lastMonth,String nextMonth); |
| | | |
| | | |
| | | /** |
| | | * 查询通过的身份证 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | int countPassIdCard(String idCard); |
| | | |
| | | |
| | | /** |
| | | * 根据身份证获取申请表 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<PlacementApplyRecord> getRecordsByCardIds(List<String> ids); |
| | | |
| | | |
| | | List<Map<String,Object>> countError(Long applyId); |
| | | |
| | | |
| | | PlacementApplyRecord getRecordsByCardId(String idCard); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementApply; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import com.ruoyi.bussiness.object.request.placementApply.*; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyPageResponse; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyRecordIdRequest; |
| | | import com.ruoyi.bussiness.object.response.placementApply.PlacementApplyRecordPageResponse; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | public interface PlacementApplyService extends IService<PlacementApply> { |
| | | |
| | | /** |
| | | * 分页 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | PlacementApplyPageResponse page(PlacementApplyPageRequest request); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | PlacementApplyRecordPageResponse detail(PlacementApplyRecordPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param request |
| | | */ |
| | | void del(PlacementApplyIdRequest request); |
| | | |
| | | |
| | | /** |
| | | * 数据审核 |
| | | * @param request |
| | | */ |
| | | void dataApprove(PlacementApplyIdRequest request); |
| | | |
| | | |
| | | void recordCheck(PlacementApplyRecordIdRequest request); |
| | | /** |
| | | * 审核 |
| | | * @param request |
| | | */ |
| | | void approve(PlacementApplyApproveRequest request); |
| | | |
| | | /** |
| | | * 导入 |
| | | * @param request |
| | | */ |
| | | void imports(PlacementImportsRequest request) throws IOException; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param request |
| | | */ |
| | | void recordAdd(PlacementApplyRecord request); |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param request |
| | | */ |
| | | PlacementApplyRecord recordDetail(PlacementApplyIdRequest request); |
| | | |
| | | |
| | | /** |
| | | * 自主购房申请批次表-记录删除 |
| | | * @param request |
| | | */ |
| | | void recordDel(PlacementApplyRecordIdRequest request); |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param request |
| | | */ |
| | | void recordEdit(PlacementApplyRecord request); |
| | | |
| | | /** |
| | | * 导出问题数据 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | void problemExport(ApplyProblemExportRequest request, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 导出全部数据(审核通过) |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | void allExport(ApplyAllExportRequest request, HttpServletResponse response); |
| | | |
| | | |
| | | /** |
| | | * 查询最后一个批次信息 |
| | | * @return |
| | | */ |
| | | String selectLastBatchNumber(); |
| | | |
| | | |
| | | /** |
| | | * 判断名字是否和户主名称+家庭成员名称重复,重复就标注 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | Integer selectNameExists(String name,String idCard); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.PlacementBatchDetailRequest; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.ProblemExportRequest; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface PlacementBatchAssetService extends IService<PlacementBatchAsset> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | Page<PlacementBatchAsset> page(PlacementBatchDetailRequest request); |
| | | |
| | | |
| | | /** |
| | | * 问题数据 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | List<PlacementBatchAsset> problemList(ProblemExportRequest request); |
| | | |
| | | |
| | | /** |
| | | * 所有数据 |
| | | * @param placementBatchId |
| | | * @return |
| | | */ |
| | | List<PlacementBatchAsset> allList(Long placementBatchId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.PlacementBatchDetailRequest; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.ProblemExportRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.GetHouseHistoryRequest; |
| | | import com.ruoyi.bussiness.object.response.report.DetailPageResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportPageResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportSumResponse; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PlacementBatchHouseholdService extends IService<PlacementBatchHousehold> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | Page<PlacementBatchHousehold> page(PlacementBatchDetailRequest request); |
| | | |
| | | |
| | | /** |
| | | * 问题数据 |
| | | */ |
| | | List<PlacementBatchHousehold> problemList(ProblemExportRequest request); |
| | | |
| | | |
| | | /** |
| | | * 所有数据 |
| | | * @param placementBatchId |
| | | * @return |
| | | */ |
| | | List<PlacementBatchHousehold> allList(Long placementBatchId); |
| | | |
| | | |
| | | |
| | | |
| | | //统计--------------- |
| | | |
| | | /** |
| | | * 总汇 |
| | | * @param street |
| | | * @return |
| | | */ |
| | | ReportSumResponse sumHousehold(String street); |
| | | |
| | | |
| | | /** |
| | | * 汇总统计 |
| | | * @return |
| | | */ |
| | | ReportPageResponse reportPage(ReportPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> reportExportsList(DetailExportsRequest request); |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | DetailPageResponse detailPage(DetailPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 本月应支付,就统计当月需要支付的 首付款、和过渡补贴支付总额。 |
| | | */ |
| | | BigDecimal sumCurrentMonth(); |
| | | |
| | | |
| | | /** |
| | | * 参与人数 |
| | | * @return |
| | | */ |
| | | BigDecimal countCurrentPerson(); |
| | | |
| | | |
| | | /** |
| | | * 街镇参与人数统计 |
| | | * @return |
| | | */ |
| | | List<StreetResponse> getStreetResponse(); |
| | | |
| | | |
| | | /** |
| | | * 错误数据统计 |
| | | * @return |
| | | */ |
| | | List<ImportErrorResponse> getImportErrorResponse(); |
| | | |
| | | |
| | | /** |
| | | * 地图数据 |
| | | * @return |
| | | */ |
| | | List<MapResponse> getMapResponse(); |
| | | |
| | | |
| | | /** |
| | | * 季度进度款 |
| | | * @return |
| | | */ |
| | | List<QuarterProcessResponse> getQuarterProcessResponse(ReportRequest request); |
| | | |
| | | /** |
| | | * 房屋类型占比 |
| | | * @return |
| | | */ |
| | | List<PlacementTypeResponse> getPlacementTypeResponse(); |
| | | |
| | | /** |
| | | * 本月补偿金额 |
| | | * @return |
| | | */ |
| | | List<MonthCompensationResponse> getMonthCompensationResponse(String month); |
| | | |
| | | |
| | | /** |
| | | * 未来4季度支付款项 |
| | | * @param quarters |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> getQuarterPayResponse(List<String> quarters); |
| | | |
| | | /** |
| | | * 根据身份证查询购房信息 |
| | | * @param idCards |
| | | * @return |
| | | */ |
| | | List<PlacementBatchHousehold> getPlacementByCardIds(List<String> idCards); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询某一季度 |
| | | * @param quarter |
| | | * @return |
| | | */ |
| | | BigDecimal getPayMoneyByQuarter(String quarter); |
| | | |
| | | |
| | | |
| | | List<PlacementBatchHousehold> getHouseHistory(GetHouseHistoryRequest request); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementBatch; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.*; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementBatchDetailResponse; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.PlacementBatchPageResponse; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PlacementBatchService extends IService<PlacementBatch> { |
| | | |
| | | /** |
| | | * 安置批次分页 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | PlacementBatchPageResponse page(PlacementBatchPageRequest request); |
| | | |
| | | /** |
| | | * 导入 |
| | | * @param request |
| | | */ |
| | | void imports(PlacementBatchImportRequest request); |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | PlacementBatchDetailResponse detail(PlacementBatchDetailRequest request); |
| | | |
| | | void dataApprove(PlacementBatchIdRequest request); |
| | | |
| | | |
| | | void assetCheck(IdRequest request); |
| | | |
| | | void householdCheck(IdRequest request); |
| | | |
| | | void del(PlacementBatchIdRequest request); |
| | | |
| | | void assetEdit(PlacementBatchAsset request); |
| | | |
| | | void householdEdit(PlacementBatchHousehold request); |
| | | |
| | | void assetDel(IdRequest request); |
| | | |
| | | void householdDel(IdRequest request); |
| | | |
| | | void householdAdd(PlacementBatchHousehold request); |
| | | |
| | | void assetAdd(PlacementBatchAsset request); |
| | | |
| | | PlacementBatchAsset assetDetail(IdRequest request); |
| | | |
| | | PlacementBatchHousehold householdDetail(IdRequest request); |
| | | |
| | | /** |
| | | * 审核 |
| | | * @param request |
| | | */ |
| | | void approve(ApproveRequest request); |
| | | |
| | | |
| | | /** |
| | | * 问题数据导出 |
| | | * @param request |
| | | */ |
| | | void problemExport(ProblemExportRequest request, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 获取上一批次号 |
| | | * @return |
| | | */ |
| | | String getLastBatchNumber(); |
| | | |
| | | |
| | | /** |
| | | * 已参与自主购房安置统计(审核通过) |
| | | */ |
| | | SelfBuyResponse getSelfBuyResponse(); |
| | | |
| | | /** |
| | | * 各街镇参与户数排名 |
| | | */ |
| | | List<StreetResponse> getStreetResponse(); |
| | | |
| | | /** |
| | | * 问题导出数据 |
| | | * @return |
| | | */ |
| | | List<ImportErrorResponse> getImportErrorResponse(); |
| | | |
| | | |
| | | /** |
| | | * 地图数据 |
| | | * @return |
| | | */ |
| | | List<MapResponse> getMapResponse(); |
| | | |
| | | |
| | | /** |
| | | * 季度进度款 |
| | | * @return |
| | | */ |
| | | List<QuarterProcessResponse> getQuarterProcessResponse(ReportRequest request); |
| | | |
| | | /** |
| | | * 房屋类型占比 |
| | | * @return |
| | | */ |
| | | List<PlacementTypeResponse> getPlacementTypeResponse(); |
| | | |
| | | /** |
| | | * 本月补偿占比 |
| | | * @param month |
| | | * @return |
| | | */ |
| | | List<MonthCompensationResponse> getMonthCompensationResponses(String month); |
| | | |
| | | |
| | | /** |
| | | * 未来4个季度付款的款项 |
| | | * @param quarters |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> getQuarterPayResponse(List<String> quarters); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.PlacementError; |
| | | import com.ruoyi.bussiness.object.request.error.ErrorPageRequest; |
| | | import com.ruoyi.bussiness.object.response.error.ErrorPageResponse; |
| | | |
| | | public interface PlacementErrorService extends IService<PlacementError> { |
| | | |
| | | |
| | | ErrorPageResponse page(ErrorPageRequest request); |
| | | |
| | | |
| | | PlacementError getErrorByStreet(String street); |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementIdRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementImportRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementPageRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.PlacementPageResponse; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | public interface PlacementService extends IService<Placement> { |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | PlacementPageResponse page(PlacementPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param placement |
| | | */ |
| | | void add(Placement placement); |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param placement |
| | | */ |
| | | void update(Placement placement); |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | Placement detail(PlacementIdRequest request); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param request |
| | | */ |
| | | void del(PlacementIdRequest request); |
| | | |
| | | /** |
| | | * 导入 |
| | | */ |
| | | void imports(PlacementImportRequest request); |
| | | |
| | | |
| | | /** |
| | | * 查询家庭身份证是否唯一 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | int countPlacementByFamilyIdCard(String idCard); |
| | | |
| | | |
| | | /** |
| | | * 查询身份证是否唯一 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | int countPlacementByIdCard(String idCard); |
| | | |
| | | |
| | | /** |
| | | * 查询身份证 |
| | | * @param idCard |
| | | * @return |
| | | */ |
| | | List<Placement> selectPlacementIdCard(List<String> idCard); |
| | | |
| | | |
| | | /** |
| | | * 不在待安置库 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | int countNamesExists(String name); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.response.report.DetailPageResponse; |
| | | import com.ruoyi.bussiness.object.response.report.ReportPageResponse; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | public interface ReportService { |
| | | |
| | | /** |
| | | * 分页 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | ReportPageResponse page(ReportPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | DetailPageResponse detail(DetailPageRequest request); |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | void exports(DetailExportsRequest request, HttpServletResponse response) throws IOException; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service; |
| | | |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.screen.ScreenResponse; |
| | | |
| | | public interface ScreenService { |
| | | |
| | | |
| | | /** |
| | | * 数据大屏 |
| | | * @return |
| | | */ |
| | | ScreenResponse data(ReportRequest request); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.Compensate; |
| | | import com.ruoyi.bussiness.enums.CompensateEnum; |
| | | import com.ruoyi.bussiness.mapper.CompensateMapper; |
| | | import com.ruoyi.bussiness.service.CompensateService; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class CompensateServiceImpl extends ServiceImpl<CompensateMapper, Compensate> implements CompensateService { |
| | | |
| | | @Override |
| | | public void updateCompensate(List<Compensate> compensates) { |
| | | if (ObjectUtil.isNull(compensates)) { |
| | | throw new GlobalException("请至少修改一个补偿标准"); |
| | | } |
| | | saveOrUpdateBatch(compensates); |
| | | } |
| | | |
| | | @Override |
| | | public boolean compensateSettleAreaCalculate(Date time, Integer currentCollectiveNum, Integer currentNoCollectiveNum, BigDecimal area) { |
| | | List<Compensate> compensates = this.list(); |
| | | Map<String,Compensate> configMap = compensates.stream().collect(Collectors.toMap(Compensate::getConfigKey, Function.identity())); |
| | | Date date = DateUtil.parse("2014-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"); |
| | | Compensate org; |
| | | Compensate noOrg; |
| | | if (time.before(date)) { |
| | | //14年之前 |
| | | //集体 |
| | | org = configMap.get(CompensateEnum.BEFORE_ORG_AREA.getCode()); |
| | | //非集体 |
| | | noOrg = configMap.get(CompensateEnum.BEFORE_NO_ORG_AREA.getCode()); |
| | | } else { |
| | | //14年之后 |
| | | //集体 |
| | | org = configMap.get(CompensateEnum.AFTER_ORG_AREA.getCode()); |
| | | //非集体 |
| | | noOrg = configMap.get(CompensateEnum.AFTER_NO_ORG_AREA.getCode()); |
| | | } |
| | | //标准面积 |
| | | BigDecimal configValue = org.getConfigValue().multiply(new BigDecimal(currentCollectiveNum)) |
| | | .add(noOrg.getConfigValue().multiply(new BigDecimal(currentNoCollectiveNum))); |
| | | //记录面积=标准面积 = 正常 |
| | | if (area.compareTo(configValue) == 0) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean compensateSettleAreaCalculate(BigDecimal orgArea, BigDecimal noOrgArea, BigDecimal area) { |
| | | BigDecimal totalArea = orgArea.add(noOrgArea); |
| | | if(totalArea.compareTo(area) == 0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean compensateBuyCalculate(Date time, String street, |
| | | Integer currentCollectiveNum, Integer currentNoCollectiveNum, |
| | | BigDecimal compensationNewAmount,BigDecimal compensationOldAmount, |
| | | BigDecimal money) { |
| | | List<Compensate> compensates = this.list(); |
| | | Map<String, Compensate> configMap = compensates.stream().collect(Collectors.toMap(Compensate::getConfigKey, Function.identity())); |
| | | Date date = DateUtil.parse("2014-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"); |
| | | //集体面积 |
| | | Compensate orgArea; |
| | | //非集体面积 |
| | | Compensate noOrgArea; |
| | | Compensate orgPrice = null; |
| | | Compensate noOrgPrice = null; |
| | | //14年之前 |
| | | if (time.before(date)) { |
| | | //集体应安置面积 |
| | | orgArea = configMap.get(CompensateEnum.BEFORE_ORG_AREA.getCode()); |
| | | //非集体应安置面积 |
| | | noOrgArea = configMap.get(CompensateEnum.BEFORE_NO_ORG_AREA.getCode()); |
| | | if ("崇阳街道、崇庆街道、羊马街道、大划街道".contains(street)) { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_APPOINT1.getCode()); |
| | | //14年之前 专属街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_APPOINT1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_APPOINT2.getCode()); |
| | | //14年之前 专属街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_APPOINT2.getCode()); |
| | | } |
| | | } else { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其余街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_OTHER1.getCode()); |
| | | //14年之前 其余街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_OTHER1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其余街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_OTHER2.getCode()); |
| | | //14年之前 其余街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_OTHER2.getCode()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //14年之后 |
| | | else{ |
| | | //集体应安置面积 |
| | | orgArea = selectCompensateByConfigKey(CompensateEnum.AFTER_ORG_AREA.getCode()); |
| | | //非集体应安置面积 |
| | | noOrgArea = selectCompensateByConfigKey(CompensateEnum.AFTER_NO_ORG_AREA.getCode()); |
| | | if ("崇阳街道、崇庆街道、羊马街道、大划街道".contains(street)) { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_APPOINT1.getCode()); |
| | | //14年之前 专属街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_APPOINT1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_APPOINT2.getCode()); |
| | | //14年之前 专属街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_APPOINT2.getCode()); |
| | | } |
| | | } else { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其他街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_OTHER1.getCode()); |
| | | //14年之前 其他街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_OTHER1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其他街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_OTHER2.getCode()); |
| | | //14年之前 其他街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_OTHER2.getCode()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (orgArea == null |
| | | || noOrgArea == null |
| | | || orgPrice == null |
| | | || noOrgPrice == null) { |
| | | return false; |
| | | } |
| | | |
| | | //计算应安置面积 |
| | | //标准面积 |
| | | BigDecimal orgWaitArea = orgArea.getConfigValue().multiply(new BigDecimal(currentCollectiveNum)); |
| | | BigDecimal noOrgWaitArea = noOrgArea.getConfigValue().multiply(new BigDecimal(currentNoCollectiveNum)); |
| | | //标准赔偿(集体) |
| | | BigDecimal orgAmount = orgWaitArea.multiply(orgPrice.getConfigValue()); |
| | | BigDecimal noOrgAmount = noOrgWaitArea.multiply(noOrgPrice.getConfigValue()); |
| | | BigDecimal totalAmount = orgAmount.add(noOrgAmount); |
| | | if (money.compareTo(totalAmount) == 0) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean compensateBuyCalculateV2( |
| | | Date time, String street, |
| | | BigDecimal orgArea,BigDecimal noOrgArea, |
| | | BigDecimal compensationNewAmount,BigDecimal compensationOldAmount, |
| | | BigDecimal money |
| | | ) { |
| | | List<Compensate> compensates = this.list(); |
| | | Map<String, Compensate> configMap = compensates.stream().collect(Collectors.toMap(Compensate::getConfigKey, Function.identity())); |
| | | Date date = DateUtil.parse("2014-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | Compensate orgPrice = null; |
| | | Compensate noOrgPrice = null; |
| | | //14年之前 |
| | | if (time.before(date)) { |
| | | if ("崇阳街道、崇庆街道、羊马街道、大划街道".contains(street)) { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_APPOINT1.getCode()); |
| | | //14年之前 专属街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_APPOINT1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_APPOINT2.getCode()); |
| | | //14年之前 专属街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_APPOINT2.getCode()); |
| | | } |
| | | } else { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其余街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_OTHER1.getCode()); |
| | | //14年之前 其余街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_OTHER1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其余街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.BEFORE_BUY_ORG_OTHER2.getCode()); |
| | | //14年之前 其余街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.BEFORE_BUY_NO_ORG_OTHER2.getCode()); |
| | | } |
| | | } |
| | | }else{ |
| | | if ("崇阳街道、崇庆街道、羊马街道、大划街道".contains(street)) { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_APPOINT1.getCode()); |
| | | //14年之前 专属街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_APPOINT1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 专属街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_APPOINT2.getCode()); |
| | | //14年之前 专属街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_APPOINT2.getCode()); |
| | | } |
| | | } else { |
| | | if (compensationNewAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其他街道 集体 新建房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_OTHER1.getCode()); |
| | | //14年之前 其他街道 非集体 新建房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_OTHER1.getCode()); |
| | | } |
| | | if (compensationOldAmount.compareTo(BigDecimal.ZERO) > 0) { |
| | | //14年之前 其他街道 集体 二手房 |
| | | orgPrice = configMap.get(CompensateEnum.AFTER_BUY_ORG_OTHER2.getCode()); |
| | | //14年之前 其他街道 非集体 二手房 |
| | | noOrgPrice = configMap.get(CompensateEnum.AFTER_BUY_NO_ORG_OTHER2.getCode()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (orgArea == null |
| | | || noOrgArea == null |
| | | || orgPrice == null |
| | | || noOrgPrice == null) { |
| | | return false; |
| | | } |
| | | |
| | | //标准赔偿(集体) |
| | | BigDecimal orgAmount = orgArea.multiply(orgPrice.getConfigValue()); |
| | | BigDecimal noOrgAmount = noOrgArea.multiply(noOrgPrice.getConfigValue()); |
| | | BigDecimal totalAmount = orgAmount.add(noOrgAmount); |
| | | if (money.compareTo(totalAmount) == 0) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean compensateSubsidyCalculate(Integer currentCount,BigDecimal money) { |
| | | List<Compensate> compensates = this.list(); |
| | | Map<String, Compensate> configMap = compensates.stream().collect(Collectors.toMap(Compensate::getConfigKey, Function.identity())); |
| | | Compensate compensate = configMap.get(CompensateEnum.SUBSIDIES.getCode()); |
| | | //元/人/月发送6个月过渡补偿 |
| | | BigDecimal subsidy = new BigDecimal(currentCount.toString()).multiply(compensate.getConfigValue()).multiply(new BigDecimal("6")); |
| | | return money.multiply(new BigDecimal("10000")).compareTo(subsidy) == 0; |
| | | } |
| | | |
| | | @Override |
| | | public Compensate selectCompensateByConfigKey(String configKey) { |
| | | LambdaQueryWrapper<Compensate> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Compensate::getConfigKey, configKey); |
| | | return this.baseMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean houseCalculate(Integer currentCount, BigDecimal area) { |
| | | List<Compensate> compensates = this.list(); |
| | | Map<String, Compensate> configMap = compensates.stream().collect(Collectors.toMap(Compensate::getConfigKey, Function.identity())); |
| | | Compensate compensate = configMap.get(CompensateEnum.HOUSING.getCode()); |
| | | |
| | | BigDecimal configArea = compensate.getConfigValue().multiply(new BigDecimal(currentCount)); |
| | | if(area.compareTo(configArea) < 0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.bussiness.domain.DataFile; |
| | | import com.ruoyi.bussiness.mapper.DataFileMapper; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileAddRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileDelRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.FileUpdateRequest; |
| | | import com.ruoyi.bussiness.object.request.dataFile.ListRequest; |
| | | import com.ruoyi.bussiness.object.response.dataFile.DataFileResponse; |
| | | import com.ruoyi.bussiness.object.response.dataFile.ListResponse; |
| | | import com.ruoyi.bussiness.service.DataFileService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DataFileServiceImpl extends ServiceImpl<DataFileMapper, DataFile> implements DataFileService { |
| | | |
| | | @Override |
| | | public ListResponse list(ListRequest request) { |
| | | Page<DataFile> defaultPage = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<DataFile> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (ObjectUtils.isNotEmpty(request.getName())) { |
| | | queryWrapper.like(DataFile::getName, request.getName()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(request.getStreet())) { |
| | | queryWrapper.like(DataFile::getStreet, request.getStreet()); |
| | | } |
| | | queryWrapper.orderByDesc(DataFile::getId); |
| | | |
| | | Page<DataFile> page = this.baseMapper.selectPage(defaultPage, queryWrapper); |
| | | ListResponse response = new ListResponse(); |
| | | response.setTotal(page.getTotal()); |
| | | List<DataFileResponse> responses = BeanUtil.copyToList(page.getRecords(), DataFileResponse.class); |
| | | response.setRecords(responses); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public void add(FileAddRequest request) { |
| | | DataFile dataFile = BeanUtil.toBean(request, DataFile.class); |
| | | dataFile.setCreateUser(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | this.baseMapper.insert(dataFile); |
| | | } |
| | | |
| | | @Override |
| | | public void update(FileUpdateRequest request) { |
| | | DataFile dataFile = this.baseMapper.selectById(request.getId()); |
| | | if (ObjectUtils.isEmpty(dataFile)) { |
| | | return; |
| | | } |
| | | DataFile newFile = BeanUtil.toBean(request, DataFile.class); |
| | | this.baseMapper.updateById(newFile); |
| | | } |
| | | |
| | | @Override |
| | | public void del(FileDelRequest request) { |
| | | this.baseMapper.deleteById(request.getId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.PlacementApplyRecord; |
| | | import com.ruoyi.bussiness.mapper.PlacementApplyRecordMapper; |
| | | import com.ruoyi.bussiness.object.request.placementApply.ApplyAllExportRequest; |
| | | import com.ruoyi.bussiness.object.request.placementApply.PlacementApplyRecordPageRequest; |
| | | import com.ruoyi.bussiness.object.request.placementApply.ApplyProblemExportRequest; |
| | | import com.ruoyi.bussiness.object.response.screen.ScreenResponse; |
| | | import com.ruoyi.bussiness.service.PlacementApplyRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | | public class PlacementApplyRecordServiceImpl extends ServiceImpl<PlacementApplyRecordMapper, PlacementApplyRecord> implements PlacementApplyRecordService { |
| | | |
| | | @Override |
| | | public Page<PlacementApplyRecord> detail(PlacementApplyRecordPageRequest request) { |
| | | Page<PlacementApplyRecord> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApplyRecord::getPlacementApplyId, request.getApplyId()); |
| | | |
| | | if (ObjUtil.isNotEmpty(request.getProjectName())) { |
| | | queryWrapper.like(PlacementApplyRecord::getProjectName, request.getProjectName()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(PlacementApplyRecord::getCommunity, request.getCommunity()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getFamilyNames())){ |
| | | queryWrapper.like(PlacementApplyRecord::getWaitFamilyNames,request.getFamilyNames()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getStreet())) { |
| | | queryWrapper.like(PlacementApplyRecord::getStreet, request.getStreet()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getHeadOrIdCard())) { |
| | | queryWrapper.and(query -> query.like(PlacementApplyRecord::getHouseholdHead, request.getHeadOrIdCard()).or().like(PlacementApplyRecord::getIdCard, request.getHeadOrIdCard())); |
| | | } |
| | | queryWrapper.orderByDesc(PlacementApplyRecord::getCompensationAmountWarn, |
| | | PlacementApplyRecord::getCompensationSumWarn, |
| | | PlacementApplyRecord::getSubsidyAmountWarn, |
| | | PlacementApplyRecord::getIdCardNoWarn, |
| | | PlacementApplyRecord::getWaitFamilyAreaWarn, |
| | | PlacementApplyRecord::getQuarterPayAmountWarn, |
| | | PlacementApplyRecord::getIdCardExistsWarn, |
| | | PlacementApplyRecord::getWaitFamilyNamesNoWarn, |
| | | PlacementApplyRecord::getWaitFamilyNamesWarn, |
| | | PlacementApplyRecord::getDownPaymentAmountWarn, |
| | | PlacementApplyRecord::getId); |
| | | return this.page(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementApplyRecord> problemList(ApplyProblemExportRequest request) { |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApplyRecord::getPlacementApplyId, request.getApplyId()); |
| | | |
| | | if (ObjUtil.isNotEmpty(request.getProjectName())) { |
| | | queryWrapper.like(PlacementApplyRecord::getProjectName, request.getProjectName()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getStreet())) { |
| | | queryWrapper.like(PlacementApplyRecord::getStreet, request.getStreet()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(PlacementApplyRecord::getCommunity,request.getCommunity()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getHeadOrIdCard())) { |
| | | queryWrapper.and(query -> query.like(PlacementApplyRecord::getHouseholdHead, request.getHeadOrIdCard()).or().like(PlacementApplyRecord::getIdCard, request.getHeadOrIdCard())); |
| | | } |
| | | //问题数据条件 |
| | | queryWrapper.and(query->query.eq(PlacementApplyRecord::getWaitFamilyArea,1) |
| | | .or().eq(PlacementApplyRecord::getWaitFamilyAreaWarn,1) |
| | | .or().eq(PlacementApplyRecord::getWaitFamilyNamesWarn,1) |
| | | .or().eq(PlacementApplyRecord::getCompensationAmountWarn,1) |
| | | .or().eq(PlacementApplyRecord::getCompensationSumWarn,1) |
| | | .or().eq(PlacementApplyRecord::getIdCardExistsWarn,1) |
| | | .or().eq(PlacementApplyRecord::getSubsidyAmountWarn,1) |
| | | .or().eq(PlacementApplyRecord::getIdCardNoWarn,1) |
| | | .or().eq(PlacementApplyRecord::getQuarterPayAmountWarn,1)); |
| | | queryWrapper.orderByDesc(PlacementApplyRecord::getId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementApplyRecord> passList(ApplyAllExportRequest request) { |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApplyRecord::getPlacementApplyId, request.getApplyId()); |
| | | if (ObjUtil.isNotEmpty(request.getProjectName())) { |
| | | queryWrapper.like(PlacementApplyRecord::getProjectName, request.getProjectName()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getStreet())) { |
| | | queryWrapper.like(PlacementApplyRecord::getStreet, request.getStreet()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(PlacementApplyRecord::getCommunity,request.getCommunity()); |
| | | } |
| | | if (ObjUtil.isNotEmpty(request.getHeadOrIdCard())) { |
| | | queryWrapper.and(query -> query.like(PlacementApplyRecord::getHouseholdHead, request.getHeadOrIdCard()).or().like(PlacementApplyRecord::getIdCard, request.getHeadOrIdCard())); |
| | | } |
| | | queryWrapper.orderByDesc(PlacementApplyRecord::getId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<PlacementApplyRecord> allData(Long applyId) { |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApplyRecord::getPlacementApplyId,applyId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public ScreenResponse queryMainData(String month, String lastMonth, String nextMonth) { |
| | | return this.baseMapper.queryMainData(month,lastMonth,nextMonth); |
| | | } |
| | | |
| | | @Override |
| | | public int countPassIdCard(String idCard) { |
| | | return this.baseMapper.countPassIdCard(idCard.trim()); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementApplyRecord> getRecordsByCardIds(List<String> ids) { |
| | | List<PlacementApplyRecord> records = this.baseMapper.getRecordsByCardIds(ids); |
| | | return records == null ? Collections.emptyList() : records; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> countError(Long applyId) { |
| | | return this.baseMapper.countError(applyId); |
| | | } |
| | | |
| | | @Override |
| | | public PlacementApplyRecord getRecordsByCardId(String idCard) { |
| | | return this.baseMapper.getRecordsByCardId(idCard); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.*; |
| | | import com.ruoyi.bussiness.enums.MessageTypeEnum; |
| | | import com.ruoyi.bussiness.mapper.PlacementApplyMapper; |
| | | import com.ruoyi.bussiness.object.request.placementApply.*; |
| | | import com.ruoyi.bussiness.object.response.placementApply.*; |
| | | import com.ruoyi.bussiness.service.*; |
| | | import com.ruoyi.bussiness.utils.BatchNumberUtils; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | | public class PlacementApplyServiceImpl extends ServiceImpl<PlacementApplyMapper, PlacementApply> implements PlacementApplyService { |
| | | |
| | | @Autowired |
| | | private PlacementApplyRecordService placementApplyRecordService; |
| | | @Autowired |
| | | private PlacementService placementService;; |
| | | @Autowired |
| | | private CompensateService compensateService; |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | @Autowired |
| | | private PlacementErrorService placementErrorService; |
| | | |
| | | @Override |
| | | public PlacementApplyPageResponse page(PlacementApplyPageRequest request) { |
| | | Page<PlacementApply> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<PlacementApply> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (ObjectUtil.isNotEmpty(request.getBatchNumber())) { |
| | | queryWrapper.like(PlacementApply::getBatchNumber, request.getBatchNumber()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getStatus())){ |
| | | queryWrapper.eq(PlacementApply::getStatus,request.getStatus()); |
| | | } |
| | | Page<PlacementApply> applyPage = this.page(page, queryWrapper); |
| | | |
| | | PlacementApplyPageResponse response = new PlacementApplyPageResponse(); |
| | | response.setTotal(applyPage.getTotal()); |
| | | response.setRecords(applyPage.getRecords()); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public PlacementApplyRecordPageResponse detail(PlacementApplyRecordPageRequest request) { |
| | | //查询申请表 |
| | | PlacementApply placementApply = this.getById(request.getApplyId()); |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | throw new GlobalException("申请表不存在!"); |
| | | } |
| | | |
| | | //查询详情 |
| | | Page<PlacementApplyRecord> applies = placementApplyRecordService.detail(request); |
| | | PlacementApplyRecordPageResponse response = new PlacementApplyRecordPageResponse(); |
| | | response.setPlacementApply(placementApply); |
| | | response.setRecords(applies.getRecords()); |
| | | response.setTotal(applies.getTotal()); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public void del(PlacementApplyIdRequest request) { |
| | | this.removeById(request.getId()); |
| | | placementApplyRecordService.remove(new LambdaQueryWrapper<PlacementApplyRecord>(). |
| | | eq(PlacementApplyRecord::getPlacementApplyId, request.getId())); |
| | | } |
| | | |
| | | @Override |
| | | public void dataApprove(PlacementApplyIdRequest request) { |
| | | PlacementApply placementApply = this.getById(request.getId()); |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | throw new GlobalException("数据不存在"); |
| | | } |
| | | if(placementApply.getStatus() != 0){ |
| | | throw new GlobalException("数据已审核通过!"); |
| | | } |
| | | dataTag(placementApply); |
| | | } |
| | | |
| | | @Override |
| | | public void recordCheck(PlacementApplyRecordIdRequest request) { |
| | | LambdaUpdateWrapper<PlacementApplyRecord> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(PlacementApplyRecord::getChecks,1); |
| | | updateWrapper.set(PlacementApplyRecord::getIdCardExistsWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getIdCardNoWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getWaitFamilyNamesWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getWaitFamilyNamesNoWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getWaitFamilyAreaWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getCompensationSumWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getCompensationAmountWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getQuarterPayAmountWarn,0); |
| | | updateWrapper.set(PlacementApplyRecord::getSubsidyAmountWarn,0); |
| | | |
| | | updateWrapper.eq(PlacementApplyRecord::getId,request.getId()); |
| | | placementApplyRecordService.update(updateWrapper); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 数据标注 |
| | | * @param placementApply |
| | | */ |
| | | private void dataTag(PlacementApply placementApply) { |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | return; |
| | | } |
| | | //数据已经审核过了,不需要标注 |
| | | if (placementApply.getStatus() != 0) { |
| | | return; |
| | | } |
| | | List<PlacementApplyRecord> records = placementApplyRecordService.allData(placementApply.getId()); |
| | | if (ObjUtil.isEmpty(records)) { |
| | | return; |
| | | } |
| | | for (PlacementApplyRecord record : records) { |
| | | if(record.getChecks() == 1){ |
| | | //已核对直接跳过 |
| | | continue; |
| | | } |
| | | //户主身份证查询 |
| | | int count = placementService.countPlacementByIdCard(record.getIdCard()); |
| | | if (count == 0) { |
| | | //安置表户主信息不存在 |
| | | record.setIdCardExistsWarn(1); |
| | | }else{ |
| | | record.setIdCardExistsWarn(0); |
| | | } |
| | | //判断户主是否重名 |
| | | if (ObjUtil.isNotEmpty(record.getIdCard())) { |
| | | boolean exists = false; |
| | | int counts = selectNameExists(record.getHouseholdHead(), record.getIdCard()); |
| | | if (counts > 1) { |
| | | exists = true; |
| | | } |
| | | record.setIdCardNoWarn(exists ? 1 : 0); |
| | | } |
| | | //判断家庭成员是否重复 |
| | | if (ObjUtil.isNotEmpty(record.getWaitFamilyNames())) { |
| | | String[] familyNames = record.getWaitFamilyNames().split("、"); |
| | | if (ObjUtil.isEmpty(familyNames)) { |
| | | record.setIdCardNoWarn(0); |
| | | } else { |
| | | boolean exists = false; |
| | | boolean familyWarn = false; |
| | | for (String familyName : familyNames) { |
| | | //查询待安置成员是否在安置库 |
| | | if (placementService.countNamesExists(familyName) == 0) { |
| | | familyWarn = true; |
| | | break; |
| | | } |
| | | } |
| | | //重复 |
| | | for (String familyName : familyNames) { |
| | | int counts = selectFamilyNameExists(familyName); |
| | | if (counts > 1) { |
| | | exists = true; |
| | | break; |
| | | } |
| | | } |
| | | record.setWaitFamilyNamesWarn(exists ? 1 : 0); |
| | | record.setWaitFamilyNamesNoWarn(familyWarn ? 1 : 0); |
| | | } |
| | | } |
| | | //应安置面积警告标注(新版本警告) |
| | | BigDecimal waitFamilyArea = record.getWaitFamilyArea(); |
| | | // Integer currentCollectiveNum = record.getCurrentCollectiveNum(); |
| | | // Integer currentNoCollectiveNum = record.getCurrentNoCollectiveNum(); |
| | | boolean warn = compensateService.compensateSettleAreaCalculate(record.getOrgArea(),record.getNoOrgArea(), waitFamilyArea); |
| | | if (warn) { |
| | | record.setWaitFamilyAreaWarn(0); |
| | | }else{ |
| | | record.setWaitFamilyAreaWarn(1); |
| | | } |
| | | |
| | | //赔偿金额(判断新购房还是二手房,这两个只能存在一个) |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) == 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | | } |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) > 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | | } |
| | | |
| | | //自主购房补贴、过渡补贴(如果购房情况异常则不判定自主购房补贴是否异常,自主购房补贴、过渡补贴 依赖赔偿金额信息) |
| | | if (record.getCompensationAmountWarn() == 0) { |
| | | boolean warnFlag = compensateService.compensateBuyCalculateV2(record.getDemolitionTime(), |
| | | record.getStreet(), |
| | | record.getOrgArea(), record.getNoOrgArea(), |
| | | record.getCompensationNewAmount(), record.getCompensationOldAmount(), |
| | | record.getCompensationSum()); |
| | | record.setCompensationSumWarn(warnFlag ? 0 : 1); |
| | | |
| | | //过渡补贴 |
| | | if (compensateService.compensateSubsidyCalculate(record.getCurrentCount(), record.getSubsidyAmount())) { |
| | | record.setSubsidyAmountWarn(0); |
| | | }else{ |
| | | record.setSubsidyAmountWarn(1); |
| | | } |
| | | } |
| | | |
| | | //每季度支付款项 |
| | | BigDecimal pay = record.getCompensationSum().multiply(new BigDecimal("0.25")); |
| | | BigDecimal quarterPayAmount = (record.getCompensationSum().subtract(pay)).divide(new BigDecimal("20"), 10, RoundingMode.DOWN); |
| | | if (quarterPayAmount.compareTo(record.getQuarterPayAmount()) != 0) { |
| | | record.setQuarterPayAmountWarn(1); |
| | | }else{ |
| | | record.setQuarterPayAmountWarn(0); |
| | | } |
| | | |
| | | //首付款警告 |
| | | boolean downPaymentAmountWarn = true; |
| | | BigDecimal cateAmount = record.getCompensationSum().multiply(new BigDecimal("0.25")); |
| | | if(cateAmount.compareTo(record.getDownPaymentAmount()) == 0){ |
| | | downPaymentAmountWarn = false; |
| | | } |
| | | record.setDownPaymentAmountWarn(downPaymentAmountWarn ? 1 : 0); |
| | | } |
| | | placementApplyRecordService.saveOrUpdateBatch(records); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计数据 |
| | | */ |
| | | public void countError(PlacementApply placementApply) { |
| | | // List<Map<String, Object>> error = placementApplyRecordService.countError(placementApply.getId()); |
| | | // if (ObjUtil.isEmpty(error)) { |
| | | // return; |
| | | // } |
| | | // for (Map<String, Object> map : error) { |
| | | // String street = map.get("street").toString(); |
| | | // PlacementError placementError = placementErrorService.getErrorByStreet(street); |
| | | // placementError.setErrorNum(placementError.getErrorNum() + NumberUtil.parseInt(map.get("errorNum").toString())); |
| | | // placementError.setSettleNum(placementError.getSettleNum() + NumberUtil.parseInt(map.get("settleNum").toString())); |
| | | // placementError.setAreaNum(placementError.getAreaNum() + NumberUtil.parseInt(map.get("areaNum").toString())); |
| | | // placementError.setCompensationNum(placementError.getCompensationNum() + NumberUtil.parseInt(map.get("compensationNum").toString())); |
| | | // placementErrorService.updateById(placementError); |
| | | // } |
| | | //查询当前批次信息 |
| | | List<PlacementApplyRecord> placementApplies = placementApplyRecordService.allData(placementApply.getId()); |
| | | |
| | | if(ObjUtil.isNotEmpty(placementApplies)){ |
| | | List<PlacementError> placementErrors = new ArrayList<>(); |
| | | /** |
| | | * sum(id_card_exists_warn+id_card_no_warn+wait_family_names_warn+wait_family_names_no_warn) as settleNum, |
| | | * sum(wait_family_area_warn) as areaNum, |
| | | * sum(compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) compensationNum |
| | | */ |
| | | for(PlacementApplyRecord applyRecord : placementApplies){ |
| | | PlacementError placementError = new PlacementError(); |
| | | |
| | | Integer settleNum = applyRecord.getIdCardExistsWarn() + applyRecord.getIdCardNoWarn() |
| | | + applyRecord.getWaitFamilyNamesNoWarn()+applyRecord.getWaitFamilyNamesWarn(); |
| | | |
| | | Integer areaNum = applyRecord.getWaitFamilyAreaWarn(); |
| | | |
| | | Integer compensationNum = applyRecord.getSubsidyAmountWarn()+ |
| | | applyRecord.getCompensationSumWarn()+applyRecord.getQuarterPayAmountWarn() |
| | | +applyRecord.getDownPaymentAmountWarn(); |
| | | |
| | | Integer errorNum = settleNum + areaNum + compensationNum; |
| | | |
| | | placementError.setStreet(applyRecord.getStreet()); |
| | | placementError.setErrorNum(errorNum); |
| | | placementError.setSettleNum(settleNum); |
| | | placementError.setAreaNum(areaNum); |
| | | placementError.setCompensationNum(compensationNum); |
| | | placementErrors.add(placementError); |
| | | } |
| | | placementErrorService.saveBatch(placementErrors); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void approve(PlacementApplyApproveRequest request) { |
| | | //查询申请表 |
| | | PlacementApply placementApply = this.getById(request.getApplyId()); |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | throw new GlobalException("申请表不存在!"); |
| | | } |
| | | if (request.getStatus() != 1 && request.getStatus() != 2) { |
| | | throw new GlobalException("审核状态不正确"); |
| | | } |
| | | if (placementApply.getStatus() != 0) { |
| | | throw new GlobalException("已经审核过了"); |
| | | } |
| | | |
| | | //修改审核状态 |
| | | placementApply.setStatus(request.getStatus()); |
| | | //原因 |
| | | placementApply.setReason(request.getReason()); |
| | | placementApply.setApproveTime(new Date()); |
| | | placementApply.setApproveName(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | placementApply.setApproveId(SecurityUtils.getUserId()); |
| | | this.updateById(placementApply); |
| | | |
| | | //同步待审核消息 |
| | | new Thread(() -> { |
| | | syncApplyMessage(); |
| | | }).start(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void imports(PlacementImportsRequest request) { |
| | | File file = FileUtils.convertToFile(request.getFile()); |
| | | List<Map<Integer, String>> maps = FileUtils.readExcelHead(file); |
| | | if (!Objects.equals(maps.get(0).get(0), "镇(街道)") |
| | | || !Objects.equals(maps.get(0).get(1), "拆迁项目名称") |
| | | || !Objects.equals(maps.get(0).get(2), "所在村(社区)") |
| | | || !Objects.equals(maps.get(0).get(3), "拆迁时间") |
| | | || !Objects.equals(maps.get(0).get(4), "户主姓名") |
| | | || !Objects.equals(maps.get(0).get(5), "身份证号") |
| | | || !Objects.equals(maps.get(0).get(6), "联系电话") |
| | | ) { |
| | | throw new GlobalException("Excel表头格式不对"); |
| | | } |
| | | List<PlacementApplyTemplateResponse> dataList; |
| | | try { |
| | | dataList = EasyExcelFactory.read(file) |
| | | .head(PlacementApplyTemplateResponse.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("读取Excel文件失败:" + e.getCause()); |
| | | } |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | | throw new GlobalException("未解析出数据"); |
| | | } |
| | | |
| | | //导入数据,直接导入库 |
| | | List<PlacementApplyRecord> records = BeanUtil.copyToList(dataList, PlacementApplyRecord.class); |
| | | //校验数据(身份证必填) |
| | | for(PlacementApplyRecord record : records) { |
| | | if(ObjUtil.isEmpty(record.getIdCard())){ |
| | | throw new GlobalException(record.getHouseholdHead() + "身份证不能为空!"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getStreet())){ |
| | | throw new GlobalException("请输入街道"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getCommunity())){ |
| | | throw new GlobalException("请输入所在村(社区)"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getProjectName())){ |
| | | throw new GlobalException("请输入项目名称"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getDemolitionTime())){ |
| | | throw new GlobalException("请输入拆迁时间"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getHouseholdHead())){ |
| | | throw new GlobalException("请输入户主名称"); |
| | | } |
| | | // if(ObjUtil.isEmpty(record.getMobile())){ |
| | | // throw new GlobalException("请输入联系电话"); |
| | | // } |
| | | if(ObjUtil.isEmpty(record.getCurrentCount())){ |
| | | throw new GlobalException("请输入本次安置人数-合计"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getWaitFamilyNames())){ |
| | | throw new GlobalException("请输入待安置家庭成员"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getWaitFamilyArea())){ |
| | | throw new GlobalException("请输入待安置人员应安置面积合计"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getCompensationSum())){ |
| | | throw new GlobalException("请输入补偿金额合计"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getDownPaymentAmount())){ |
| | | throw new GlobalException("请输入25%首付款"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getQuarterPayAmount())){ |
| | | throw new GlobalException("请输入每季度需支付款项"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getSubsidyAmount())){ |
| | | throw new GlobalException("请输入过渡补贴"); |
| | | } |
| | | } |
| | | |
| | | //汇总数据准备 |
| | | PlacementApply placementApply; |
| | | if (ObjUtil.isEmpty(request.getApplyId())) { |
| | | //保存批次信息 |
| | | placementApply = new PlacementApply(); |
| | | String lastBatchNumber = selectLastBatchNumber(); |
| | | String batchNumber = BatchNumberUtils.getBatchNumber(lastBatchNumber); |
| | | placementApply.setBatchNumber(batchNumber); |
| | | placementApply.setCreateId(SecurityUtils.getUserId()); |
| | | placementApply.setCreateUser(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | this.save(placementApply); |
| | | } else { |
| | | //获取旧的批次信息 |
| | | placementApply = this.getById(request.getApplyId()); |
| | | } |
| | | |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | throw new GlobalException("申请表信息不存在!"); |
| | | } |
| | | |
| | | //添加数据 |
| | | for(PlacementApplyRecord record : records) { |
| | | record.setPlacementApplyId(placementApply.getId()); |
| | | record.setCreateId(SecurityUtils.getUserId()); |
| | | record.setCreateUser(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | } |
| | | //保存数据 |
| | | placementApplyRecordService.saveBatch(records); |
| | | //计算汇总数据 |
| | | buildSumApplyRecord(placementApply); |
| | | //同步待审核消息 |
| | | new Thread(() -> { |
| | | //标注数据(数据太多有风险) |
| | | placementApply.setStatus(0); |
| | | dataTag(placementApply); |
| | | //统计数据 |
| | | countError(placementApply); |
| | | syncApplyMessage(); |
| | | }).start(); |
| | | } |
| | | |
| | | @Override |
| | | public void recordAdd(PlacementApplyRecord request) { |
| | | placementApplyRecordService.save(request); |
| | | } |
| | | |
| | | @Override |
| | | public PlacementApplyRecord recordDetail(PlacementApplyIdRequest request) { |
| | | return placementApplyRecordService.getById(request.getId()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更新消息 |
| | | */ |
| | | private void syncApplyMessage() { |
| | | SysNotice sysNotice = sysNoticeService.getById(1); |
| | | if (ObjUtil.isEmpty(sysNotice)) { |
| | | return; |
| | | } |
| | | LambdaQueryWrapper<PlacementApply> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApply::getStatus, 0); |
| | | List<PlacementApply> applies = this.list(queryWrapper); |
| | | if (ObjUtil.isEmpty(applies)) { |
| | | return; |
| | | } |
| | | List<Long> applyIds = applies.stream().map(PlacementApply::getId).collect(Collectors.toList()); |
| | | |
| | | LambdaQueryWrapper<PlacementApplyRecord> countQuery = new LambdaQueryWrapper<>(); |
| | | countQuery.in(PlacementApplyRecord::getPlacementApplyId, applyIds); |
| | | int count = NumberUtil.parseInt(String.valueOf(placementApplyRecordService.count(countQuery))); |
| | | String msg = MessageTypeEnum.PLACEMENT_APPLY.getMessage(); |
| | | sysNotice.setNoticeTitle(StrUtil.format(msg, Integer.toString(count))); |
| | | sysNotice.setCountNum(new BigDecimal(count)); |
| | | sysNoticeService.updateById(sysNotice); |
| | | } |
| | | |
| | | @Override |
| | | public void recordDel(PlacementApplyRecordIdRequest request) { |
| | | PlacementApplyRecord placementApplyRecord = placementApplyRecordService.getById(request.getId()); |
| | | if(ObjUtil.isEmpty(placementApplyRecord)){ |
| | | throw new GlobalException("记录不存在"); |
| | | } |
| | | //查询当前记录是否已经审核 |
| | | PlacementApply placementApply = this.getById(placementApplyRecord.getPlacementApplyId()); |
| | | if(ObjUtil.isEmpty(placementApply)){ |
| | | throw new GlobalException("自主购房安置申请批次表不存在"); |
| | | } |
| | | if(placementApply.getStatus() == 1){ |
| | | throw new GlobalException("自主购房安置申请批次表已审核通过!"); |
| | | } |
| | | placementApplyRecordService.removeById(request.getId()); |
| | | //重新汇总数据 |
| | | buildSumApplyRecord(placementApply); |
| | | } |
| | | |
| | | @Override |
| | | public void recordEdit(PlacementApplyRecord request) { |
| | | //查询当前记录是否已经审核 |
| | | PlacementApply placementApply = this.getById(request.getPlacementApplyId()); |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | throw new GlobalException("自主购房安置申请批次表不存在"); |
| | | } |
| | | if (placementApply.getStatus() == 1) { |
| | | throw new GlobalException("自主购房安置申请批次表已审核通过!"); |
| | | } |
| | | placementApplyRecordService.updateById(request); |
| | | //重新汇总数据 |
| | | buildSumApplyRecord(placementApply); |
| | | dataTag(placementApply); |
| | | } |
| | | |
| | | @Override |
| | | public void problemExport(ApplyProblemExportRequest request, HttpServletResponse response) { |
| | | try { |
| | | //查询记录明细 |
| | | List<PlacementApplyRecord> applyRecords = placementApplyRecordService.problemList(request); |
| | | List<ProblemExportResponse> data = BeanUtil.copyToList(applyRecords, ProblemExportResponse.class); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, "问题数据.xlsx"); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), ProblemExportResponse.class); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出问题数据失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void allExport(ApplyAllExportRequest request, HttpServletResponse response) { |
| | | try { |
| | | //查询记录明细 |
| | | List<PlacementApplyRecord> applyRecords = placementApplyRecordService.passList(request); |
| | | List<ProblemExportResponse> data = BeanUtil.copyToList(applyRecords, ProblemExportResponse.class); |
| | | |
| | | FileUtils.setExcelResponseHeader(response, "问题数据.xlsx"); |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), ProblemExportResponse.class); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出问题数据失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 数据汇总 |
| | | */ |
| | | private void buildSumApplyRecord(PlacementApply placementApply) { |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementApplyRecord::getPlacementApplyId, placementApply.getId()); |
| | | List<PlacementApplyRecord> records = placementApplyRecordService.list(queryWrapper); |
| | | if (ObjUtil.isEmpty(records)) { |
| | | return; |
| | | } |
| | | //汇总数据 |
| | | |
| | | // 申请总户数 |
| | | Integer householdsNum = Math.toIntExact(records.stream().map(PlacementApplyRecord::getIdCard).distinct().count()); |
| | | //申请总人数 |
| | | Integer personNum = records.stream().mapToInt(PlacementApplyRecord::getCurrentCount).sum(); |
| | | |
| | | //25%首付款 |
| | | BigDecimal downPaymentAmount = records.stream().map(PlacementApplyRecord::getDownPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //每季度需支付款项(万元) |
| | | BigDecimal quarterPayAmount = records.stream().map(PlacementApplyRecord::getQuarterPayAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //过渡补贴(万元) |
| | | BigDecimal subsidyAmount = records.stream().map(PlacementApplyRecord::getSubsidyAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //待安置面积 |
| | | BigDecimal waitFamilyArea = records.stream().map(PlacementApplyRecord::getWaitFamilyArea).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | |
| | | //补偿金额(合计) |
| | | BigDecimal totalAmount = records.stream().map(PlacementApplyRecord::getCompensationSum).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // //补偿总金额(万元) = 补偿金额(合计)+ 过渡补贴(万元)+ 每季度需支付款项(万元)+ 25%首付款 |
| | | // totalAmount = totalAmount.add(downPaymentAmount).add(quarterPayAmount).add(subsidyAmount); |
| | | |
| | | placementApply.setWaitFamilyArea(waitFamilyArea); |
| | | placementApply.setHouseholdsNum(householdsNum); |
| | | placementApply.setPersonNum(personNum); |
| | | placementApply.setDownPaymentAmount(downPaymentAmount); |
| | | placementApply.setQuarterPayAmount(quarterPayAmount); |
| | | placementApply.setSubsidyAmount(subsidyAmount); |
| | | placementApply.setTotalAmount(totalAmount); |
| | | this.updateById(placementApply); |
| | | } |
| | | |
| | | @Override |
| | | public String selectLastBatchNumber() { |
| | | LambdaQueryWrapper<PlacementApply> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.orderByDesc(PlacementApply::getId); |
| | | queryWrapper.last("limit 1"); |
| | | PlacementApply placementApply = this.getOne(queryWrapper); |
| | | if (ObjUtil.isEmpty(placementApply)) { |
| | | return null; |
| | | } |
| | | return placementApply.getBatchNumber(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectNameExists(String name,String idCard) { |
| | | LambdaQueryWrapper<PlacementApply> placementApplyLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | placementApplyLambdaQueryWrapper.ne(PlacementApply::getStatus, 2); |
| | | List<PlacementApply> applies = list(placementApplyLambdaQueryWrapper); |
| | | if (ObjUtil.isEmpty(applies)) { |
| | | return 0; |
| | | } |
| | | |
| | | List<Long> applyIds = applies.stream().map(PlacementApply::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(PlacementApplyRecord::getPlacementApplyId, applyIds); |
| | | queryWrapper.and(query -> query.eq(PlacementApplyRecord::getIdCard,idCard)); |
| | | return NumberUtil.parseInt(String.valueOf(placementApplyRecordService.count(queryWrapper))); |
| | | } |
| | | |
| | | public Integer selectFamilyNameExists(String familyName) { |
| | | LambdaQueryWrapper<PlacementApply> placementApplyLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | placementApplyLambdaQueryWrapper.ne(PlacementApply::getStatus, 2); |
| | | List<PlacementApply> applies = list(placementApplyLambdaQueryWrapper); |
| | | if (ObjUtil.isEmpty(applies)) { |
| | | return 0; |
| | | } |
| | | |
| | | List<Long> applyIds = applies.stream().map(PlacementApply::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<PlacementApplyRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(PlacementApplyRecord::getPlacementApplyId, applyIds); |
| | | queryWrapper.apply(" FIND_IN_SET('"+familyName.trim()+"',REPLACE(wait_family_names,\"、\",\",\"))"); |
| | | return NumberUtil.parseInt(String.valueOf(placementApplyRecordService.count(queryWrapper))); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchAsset; |
| | | import com.ruoyi.bussiness.mapper.PlacementBatchAssetMapper; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.PlacementBatchDetailRequest; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.ProblemExportRequest; |
| | | import com.ruoyi.bussiness.service.PlacementBatchAssetService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class PlacementBatchAssetServiceImpl extends ServiceImpl<PlacementBatchAssetMapper, PlacementBatchAsset> implements PlacementBatchAssetService { |
| | | |
| | | @Override |
| | | public Page<PlacementBatchAsset> page(PlacementBatchDetailRequest request) { |
| | | Page<PlacementBatchAsset> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<PlacementBatchAsset> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchAsset::getPlacementBatchId,request.getPlacementBatchId()); |
| | | if(ObjUtil.isNotEmpty(request.getStreet())){ |
| | | queryWrapper.like(PlacementBatchAsset::getStreet, request.getStreet()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(PlacementBatchAsset::getCommunity, request.getCommunity()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getHouseholdHead())){ |
| | | queryWrapper.like(PlacementBatchAsset::getHouseholdHead,request.getHouseholdHead()); |
| | | } |
| | | queryWrapper.orderByDesc(PlacementBatchAsset::getWaitFamilyAreaWarn, |
| | | PlacementBatchAsset::getCompensationSumWarn, |
| | | PlacementBatchAsset::getHouseholdHeadWarn, |
| | | PlacementBatchAsset::getSubsidyAmountWarn, |
| | | PlacementBatchAsset::getPriceAmountWarn, |
| | | PlacementBatchAsset::getIdCardWarn, |
| | | PlacementBatchAsset::getTwoPriceWarn, |
| | | PlacementBatchAsset::getQuarterPayAmountWarn, |
| | | PlacementBatchAsset::getDownPaymentAmountWarn, |
| | | PlacementBatchAsset::getId); |
| | | return this.baseMapper.selectPage(page,queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchAsset> problemList(ProblemExportRequest request) { |
| | | LambdaQueryWrapper<PlacementBatchAsset> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchAsset::getPlacementBatchId, request.getPlacementBatchId()); |
| | | queryWrapper.and(query -> query.eq(PlacementBatchAsset::getWaitFamilyAreaWarn, 1) |
| | | .or().eq(PlacementBatchAsset::getCompensationSumWarn, 1) |
| | | .or().eq(PlacementBatchAsset::getHouseholdHeadWarn, 1) |
| | | .or().eq(PlacementBatchAsset::getPriceAmountWarn, 1) |
| | | .or().eq(PlacementBatchAsset::getSubsidyAmountWarn, 1) |
| | | .or().eq(PlacementBatchAsset::getQuarterPayAmountWarn, 1)); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchAsset> allList(Long placementBatchId) { |
| | | LambdaQueryWrapper<PlacementBatchAsset> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchAsset::getPlacementBatchId, placementBatchId); |
| | | queryWrapper.orderByDesc(PlacementBatchAsset::getId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.mapper.PlacementBatchHouseholdMapper; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.PlacementBatchDetailRequest; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.ProblemExportRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.GetHouseHistoryRequest; |
| | | import com.ruoyi.bussiness.object.response.report.*; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Service |
| | | public class PlacementBatchHouseholdServiceImpl extends ServiceImpl<PlacementBatchHouseholdMapper, PlacementBatchHousehold> implements PlacementBatchHouseholdService { |
| | | |
| | | @Override |
| | | public Page<PlacementBatchHousehold> page(PlacementBatchDetailRequest request) { |
| | | Page<PlacementBatchHousehold> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<PlacementBatchHousehold> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId,request.getPlacementBatchId()); |
| | | if(ObjUtil.isNotEmpty(request.getStreet())){ |
| | | queryWrapper.like(PlacementBatchHousehold::getStreet,request.getStreet()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(PlacementBatchHousehold::getCommunity,request.getCommunity()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getHouseholdHead())){ |
| | | queryWrapper.like(PlacementBatchHousehold::getHouseholdHead,request.getHouseholdHead()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getFamilyNames())){ |
| | | queryWrapper.like(PlacementBatchHousehold::getWaitFamilyNames,request.getFamilyNames()); |
| | | } |
| | | queryWrapper.orderByDesc( |
| | | PlacementBatchHousehold::getWaitFamilyNamesNoWarn, |
| | | PlacementBatchHousehold::getWaitFamilyAreaWarn, |
| | | PlacementBatchHousehold::getQuarterPayAmountWarn, |
| | | PlacementBatchHousehold::getAreaWarn, |
| | | PlacementBatchHousehold::getHouseholdHeadWarn, |
| | | PlacementBatchHousehold::getIdCardWarn, |
| | | PlacementBatchHousehold::getCompensationAmountWarn, |
| | | PlacementBatchHousehold::getSubsidyAmountWarn, |
| | | PlacementBatchHousehold::getWaitFamilyNamesWarn, |
| | | PlacementBatchHousehold::getDownPaymentAmountWarn, |
| | | PlacementBatchHousehold::getCompensationSumWarn, |
| | | PlacementBatchHousehold::getId |
| | | ); |
| | | return this.page(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchHousehold> problemList(ProblemExportRequest request) { |
| | | LambdaQueryWrapper<PlacementBatchHousehold> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId,request.getPlacementBatchId()); |
| | | queryWrapper.and(query->query.eq(PlacementBatchHousehold::getAreaWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getCompensationAmountWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getHouseholdHeadWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getIdCardWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getCompensationSumWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getSubsidyAmountWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getQuarterPayAmountWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getWaitFamilyAreaWarn,1) |
| | | .or().eq(PlacementBatchHousehold::getWaitFamilyNamesWarn,1)); |
| | | |
| | | queryWrapper.orderByDesc(PlacementBatchHousehold::getId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchHousehold> allList(Long placementBatchId) { |
| | | LambdaQueryWrapper<PlacementBatchHousehold> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId,placementBatchId); |
| | | queryWrapper.orderByDesc(PlacementBatchHousehold::getId); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public ReportSumResponse sumHousehold(String street) { |
| | | ReportSumResponse reportSumResponse = this.baseMapper.reportPlacementHouseholdSum(street); |
| | | if(ObjUtil.isEmpty(reportSumResponse)){ |
| | | reportSumResponse = new ReportSumResponse(); |
| | | } |
| | | return reportSumResponse; |
| | | } |
| | | |
| | | @Override |
| | | public ReportPageResponse reportPage(ReportPageRequest request) { |
| | | Page<Map<String, Object>> defaultPage = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | Page<Map<String, Object>> pageData = this.baseMapper.reportPage(defaultPage, request); |
| | | ReportPageResponse response = new ReportPageResponse(); |
| | | response.setTotal(pageData.getTotal()); |
| | | // **保证返回的 records 按 quarters 的顺序排列** |
| | | List<Map<String, Object>> sortedRecords = sortQuarterlyData(pageData.getRecords(), request.getQuarters()); |
| | | response.setRecords(sortedRecords); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> reportExportsList(DetailExportsRequest request) { |
| | | List<Map<String, Object>> dataMap = this.baseMapper.reportExportsList(request); |
| | | if (ObjUtil.isNotEmpty(dataMap)) { |
| | | return sortResultFields(dataMap); |
| | | } |
| | | return dataMap; |
| | | } |
| | | |
| | | @Override |
| | | public DetailPageResponse detailPage(DetailPageRequest request) { |
| | | Page<DetailResponse> defaulePage = new Page<>(request.getPageNum(),request.getPageSize()); |
| | | Page<DetailResponse> pageData = this.baseMapper.detailPage(defaulePage,request); |
| | | |
| | | DetailPageResponse response = new DetailPageResponse(); |
| | | response.setTotal(pageData.getTotal()); |
| | | response.setRecords(pageData.getRecords()); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal sumCurrentMonth() { |
| | | //本月应支付,就统计当月需要支付的 首付款、和过渡补贴支付总额。 |
| | | String month = DateUtil.format(new Date(),"yyyy-MM"); |
| | | return this.baseMapper.sumCurrentMonth(month); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal countCurrentPerson() { |
| | | //你只需要把审核通过的 购房表 的人,以及签订时间从当前日期算,不超过2个月的 合计个人数统计就行了 |
| | | return this.baseMapper.countCurrentPerson(); |
| | | } |
| | | |
| | | @Override |
| | | public List<StreetResponse> getStreetResponse() { |
| | | return this.baseMapper.getStreetResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ImportErrorResponse> getImportErrorResponse() { |
| | | return this.baseMapper.getImportErrorResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MapResponse> getMapResponse() { |
| | | return this.baseMapper.getMapResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<QuarterProcessResponse> getQuarterProcessResponse(ReportRequest request) { |
| | | return this.baseMapper.getQuarterProcessResponse(request); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementTypeResponse> getPlacementTypeResponse() { |
| | | return this.baseMapper.getPlacementTypeResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthCompensationResponse> getMonthCompensationResponse(String month) { |
| | | return this.baseMapper.getMonthCompensationResponse(month); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getQuarterPayResponse(List<String> quarters) { |
| | | return this.baseMapper.getQuarterPayResponse(quarters); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchHousehold> getPlacementByCardIds(List<String> idCards) { |
| | | List<PlacementBatchHousehold> households = this.baseMapper.getPlacementByIdCards(idCards); |
| | | return households == null ? Collections.emptyList() : households; |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal getPayMoneyByQuarter(String quarter) { |
| | | return this.baseMapper.getPayMoneyByQuarter(quarter); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementBatchHousehold> getHouseHistory(GetHouseHistoryRequest request) { |
| | | return this.baseMapper.getHouseHistory(request); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 索引排序 |
| | | * @param resultList |
| | | * @return |
| | | */ |
| | | public static List<Map<String, Object>> sortResultFields(List<Map<String, Object>> resultList) { |
| | | List<Map<String, Object>> sortedList = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> row : resultList) { |
| | | // 使用 TreeMap 排序 |
| | | Map<String, Object> sortedMap = new LinkedHashMap<>(); |
| | | |
| | | // 提取所有字段名 |
| | | List<String> keys = new ArrayList<>(row.keySet()); |
| | | |
| | | // 按照规则排序 |
| | | keys.sort((k1, k2) -> { |
| | | // 先把 "valueX" 取出来按索引排序 |
| | | boolean isValue1 = k1.matches("value\\d+"); |
| | | boolean isValue2 = k2.matches("value\\d+"); |
| | | |
| | | if (isValue1 && isValue2) { |
| | | // 提取 value 后的数字并比较 |
| | | int index1 = Integer.parseInt(k1.replace("value", "")); |
| | | int index2 = Integer.parseInt(k2.replace("value", "")); |
| | | return Integer.compare(index1, index2); |
| | | } else if (isValue1) { |
| | | return 1; // valueX 在后 |
| | | } else if (isValue2) { |
| | | return -1; // valueX 在后 |
| | | } else { |
| | | return k1.compareTo(k2); // 其他字段按照字母顺序排序 |
| | | } |
| | | }); |
| | | |
| | | // 按排序好的 key 顺序放入新 Map |
| | | for (String key : keys) { |
| | | sortedMap.put(key, row.get(key)); |
| | | } |
| | | |
| | | sortedList.add(sortedMap); |
| | | } |
| | | |
| | | return sortedList; |
| | | } |
| | | |
| | | /** |
| | | * 时间排序 |
| | | * @param records |
| | | * @param quarters |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> sortQuarterlyData(List<Map<String, Object>> records, List<String> quarters) { |
| | | List<Map<String, Object>> sortedRecords = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> record : records) { |
| | | // 先保留 street、downPaymentAmount、subsidyAmount 等固定字段 |
| | | Map<String, Object> sortedMap = new LinkedHashMap<>(); |
| | | sortedMap.put("street", record.get("street")); |
| | | sortedMap.put("currentCount", record.get("currentCount")); |
| | | sortedMap.put("downPaymentAmount", record.get("downPaymentAmount")); |
| | | sortedMap.put("subsidyAmount", record.get("subsidyAmount")); |
| | | sortedMap.put("compensationSum",record.get("compensationSum")); |
| | | |
| | | // 按 quarters 的顺序加入季度数据 |
| | | for (String quarter : quarters) { |
| | | sortedMap.put(quarter, record.getOrDefault(quarter, 0.00)); // 没有数据的季度填 0 |
| | | } |
| | | |
| | | sortedRecords.add(sortedMap); |
| | | } |
| | | |
| | | return sortedRecords; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.*; |
| | | import com.ruoyi.bussiness.enums.MessageTypeEnum; |
| | | import com.ruoyi.bussiness.mapper.PlacementBatchMapper; |
| | | import com.ruoyi.bussiness.object.request.placementBatch.*; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.placementApply.ProblemExportResponse; |
| | | import com.ruoyi.bussiness.object.response.placementBatch.*; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | import com.ruoyi.bussiness.service.*; |
| | | import com.ruoyi.bussiness.utils.BatchNumberUtils; |
| | | import com.ruoyi.bussiness.utils.PaymentCycleHelper; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class PlacementBatchServiceImpl extends ServiceImpl<PlacementBatchMapper, PlacementBatch> implements PlacementBatchService { |
| | | |
| | | @Autowired |
| | | private PlacementBatchAssetService placementBatchAssetService; |
| | | @Autowired |
| | | private PlacementBatchHouseholdService placementBatchHouseholdService; |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | @Autowired |
| | | private PlacementApplyRecordService placementApplyRecordService; |
| | | @Autowired |
| | | private CompensateService compensateService; |
| | | @Autowired |
| | | private PlacementService placementService; |
| | | @Autowired |
| | | private PlacementErrorService placementErrorService; |
| | | |
| | | @Override |
| | | public PlacementBatchPageResponse page(PlacementBatchPageRequest request) { |
| | | Page<PlacementBatch> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<PlacementBatch> wrapper = new LambdaQueryWrapper<>(); |
| | | if (ObjUtil.isNotEmpty(request.getBatchNumber())) { |
| | | wrapper.like(PlacementBatch::getBatchNumber, request.getBatchNumber()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getStatus())){ |
| | | wrapper.eq(PlacementBatch::getStatus,request.getStatus()); |
| | | } |
| | | wrapper.orderByDesc(PlacementBatch::getId); |
| | | |
| | | Page<PlacementBatch> pageData = baseMapper.selectPage(page, wrapper); |
| | | |
| | | PlacementBatchPageResponse response = new PlacementBatchPageResponse(); |
| | | response.setRecords(pageData.getRecords()); |
| | | response.setTotal(pageData.getTotal()); |
| | | return response; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void imports(PlacementBatchImportRequest request) { |
| | | //判断数据 |
| | | if (ObjUtil.isEmpty(request.getId())) { |
| | | if (ObjUtil.isEmpty(request.getAssetFile())) { |
| | | throw new GlobalException("请上传资金表"); |
| | | } |
| | | if (ObjUtil.isEmpty(request.getHouseholdFile())) { |
| | | throw new GlobalException("请上传房产表"); |
| | | } |
| | | } else { |
| | | if (ObjUtil.isEmpty(request.getAssetFile()) |
| | | && ObjUtil.isEmpty(request.getHouseholdFile())) { |
| | | throw new GlobalException("请至少上传资金表或者房产表"); |
| | | } |
| | | } |
| | | |
| | | //新增安置批次表信息 |
| | | PlacementBatch placementBatch; |
| | | if (ObjUtil.isEmpty(request.getId())) { |
| | | placementBatch = new PlacementBatch(); |
| | | String batchNumber = BatchNumberUtils.getBatchNumber(getLastBatchNumber()); |
| | | placementBatch.setBatchNumber(batchNumber); |
| | | placementBatch.setCreateId(SecurityUtils.getUserId()); |
| | | placementBatch.setCreateUser(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | save(placementBatch); |
| | | } else { |
| | | placementBatch = baseMapper.selectById(request.getId()); |
| | | } |
| | | |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次信息不存在!"); |
| | | } |
| | | |
| | | //导入资金表 |
| | | if (ObjUtil.isNotEmpty(request.getAssetFile())) { |
| | | importAsset(placementBatch.getId(), request.getAssetFile()); |
| | | } |
| | | //导入房产表 |
| | | if (ObjUtil.isNotEmpty(request.getHouseholdFile())) { |
| | | importHousehold(placementBatch.getId(), request.getHouseholdFile()); |
| | | } |
| | | |
| | | //汇总数据 |
| | | sumPlacementBatch(placementBatch); |
| | | |
| | | //同步待处理消息 |
| | | new Thread(() -> { |
| | | //批注数据 |
| | | placementBatch.setStatus(0); |
| | | dataTag(placementBatch); |
| | | countError(placementBatch); |
| | | //统计错误数据 |
| | | syncApplyMessage(); |
| | | }).start(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 统计数据 |
| | | */ |
| | | public void countError(PlacementBatch placementBatch) { |
| | | // List<Map<String, Object>> error = this.baseMapper.countError(placementBatch.getId()); |
| | | |
| | | //查询当前批次资金信息 |
| | | LambdaQueryWrapper<PlacementBatchAsset> assetLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | assetLambdaQueryWrapper.eq(PlacementBatchAsset::getPlacementBatchId,placementBatch.getId()); |
| | | List<PlacementBatchAsset> assets = placementBatchAssetService.list(assetLambdaQueryWrapper); |
| | | |
| | | List<PlacementError> placementErrors = new ArrayList<>(); |
| | | if(ObjUtil.isNotEmpty(assets)){ |
| | | for(PlacementBatchAsset asset : assets){ |
| | | PlacementError placementError = new PlacementError(); |
| | | /** |
| | | * sum(household_head_warn+id_card_warn+wait_family_area_warn+two_price_warn+ |
| | | * price_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as errorNum, |
| | | * sum(household_head_warn+id_card_warn) as settleNum, |
| | | * sum(wait_family_area_warn) as areaNum, |
| | | * sum(two_price_warn+price_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as compensationNum, |
| | | */ |
| | | |
| | | Integer settleNum = asset.getHouseholdHeadWarn() + asset.getIdCardWarn(); |
| | | Integer areaNum = asset.getWaitFamilyAreaWarn(); |
| | | Integer compensationNum = asset.getTwoPriceWarn() + asset.getPriceAmountWarn() |
| | | + asset.getCompensationSumWarn()+asset.getQuarterPayAmountWarn() |
| | | + asset.getSubsidyAmountWarn() + asset.getDownPaymentAmountWarn(); |
| | | Integer errorNum = settleNum + areaNum + compensationNum; |
| | | |
| | | placementError.setStreet(asset.getStreet()); |
| | | placementError.setErrorNum(errorNum); |
| | | placementError.setSettleNum(settleNum); |
| | | placementError.setAreaNum(areaNum); |
| | | placementError.setCompensationNum(compensationNum); |
| | | placementErrors.add(placementError); |
| | | } |
| | | } |
| | | |
| | | |
| | | //查询当前批次购房信息 |
| | | LambdaQueryWrapper<PlacementBatchHousehold> householdLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | householdLambdaQueryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId,placementBatch.getId()); |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.list(householdLambdaQueryWrapper); |
| | | if (ObjUtil.isNotEmpty(households)) { |
| | | for(PlacementBatchHousehold household : households){ |
| | | PlacementError placementError = new PlacementError(); |
| | | /** |
| | | * sum(household_head_warn+id_card_warn+wait_family_names_warn+wait_family_names_no_warn) as settleNum, |
| | | * sum(wait_family_area_warn) as areaNum, |
| | | * sum(compensation_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as compensationNum, |
| | | * sum(area_warn) as houseNum |
| | | */ |
| | | Integer settleNum = household.getHouseholdHeadWarn()+household.getIdCardWarn() |
| | | +household.getWaitFamilyNamesWarn() + household.getWaitFamilyNamesNoWarn(); |
| | | Integer areaNum = household.getWaitFamilyAreaWarn(); |
| | | Integer compensationNum = household.getCompensationAmountWarn() |
| | | + household.getCompensationSumWarn() |
| | | +household.getQuarterPayAmountWarn()+household.getSubsidyAmountWarn() |
| | | +household.getDownPaymentAmountWarn(); |
| | | Integer houseNum = household.getAreaWarn(); |
| | | |
| | | Integer errorNum = settleNum + areaNum + compensationNum + houseNum; |
| | | |
| | | placementError.setStreet(household.getStreet()); |
| | | placementError.setErrorNum(errorNum); |
| | | placementError.setSettleNum(settleNum); |
| | | placementError.setAreaNum(areaNum); |
| | | placementError.setCompensationNum(compensationNum); |
| | | placementError.setHouseNum(houseNum); |
| | | placementErrors.add(placementError); |
| | | } |
| | | } |
| | | placementErrorService.saveBatch(placementErrors); |
| | | } |
| | | |
| | | /** |
| | | * 更新消息 |
| | | */ |
| | | private void syncApplyMessage() { |
| | | SysNotice sysNotice = sysNoticeService.getById(2); |
| | | LambdaQueryWrapper<PlacementBatch> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatch::getStatus, 0); |
| | | List<PlacementBatch> batches = this.list(queryWrapper); |
| | | if (ObjUtil.isEmpty(batches)) { |
| | | return; |
| | | } |
| | | List<Long> batchIds = batches.stream().map(PlacementBatch::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<PlacementBatchAsset> assetCountQuery = new LambdaQueryWrapper<>(); |
| | | assetCountQuery.eq(PlacementBatchAsset::getPlacementBatchId, batchIds); |
| | | int assetCount = NumberUtil.parseInt(String.valueOf(placementBatchAssetService.count(assetCountQuery))); |
| | | |
| | | LambdaQueryWrapper<PlacementBatchHousehold> householdCountQuery = new LambdaQueryWrapper<>(); |
| | | householdCountQuery.eq(PlacementBatchHousehold::getPlacementBatchId, batchIds); |
| | | int houseHoldCount = NumberUtil.parseInt(String.valueOf(placementBatchHouseholdService.count(householdCountQuery))); |
| | | |
| | | int count = assetCount + houseHoldCount; |
| | | String msg = MessageTypeEnum.PLACEMENT_BATCH.getMessage(); |
| | | sysNotice.setNoticeTitle(StrUtil.format(msg, Integer.toString(count))); |
| | | sysNotice.setCountNum(new BigDecimal(count)); |
| | | sysNoticeService.updateById(sysNotice); |
| | | |
| | | //当月支付补偿款 |
| | | SysNotice sysNotice2 = sysNoticeService.getById(3); |
| | | BigDecimal currentMonthMoney = placementBatchHouseholdService.sumCurrentMonth(); |
| | | String payMsg = MessageTypeEnum.PLACEMENT_PAY.getMessage(); |
| | | sysNotice2.setNoticeTitle(StrUtil.format(payMsg, currentMonthMoney)); |
| | | sysNotice2.setCountNum(currentMonthMoney); |
| | | sysNoticeService.updateById(sysNotice2); |
| | | |
| | | //审核通过的购房表的人,以及签订时间从当前日期算,不超过2个月的 合计个人数统计就行了 |
| | | SysNotice sysNotice3 = sysNoticeService.getById(4); |
| | | BigDecimal sumPersonCount = placementBatchHouseholdService.countCurrentPerson(); |
| | | String personMsg = MessageTypeEnum.PLACEMENT_FIRST_PAY.getMessage(); |
| | | sysNotice3.setNoticeTitle(StrUtil.format(personMsg, sumPersonCount)); |
| | | sysNotice3.setCountNum(sumPersonCount); |
| | | sysNoticeService.updateById(sysNotice3); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public PlacementBatchDetailResponse detail(PlacementBatchDetailRequest request) { |
| | | PlacementBatch placementBatch = this.getById(request.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次信息不存在!"); |
| | | } |
| | | |
| | | PlacementBatchDetailResponse response = new PlacementBatchDetailResponse(); |
| | | response.setPlacementBatch(placementBatch); |
| | | //根据类型查询明细记录(资金) |
| | | if (request.getType() == 1) { |
| | | //分页 |
| | | Page<PlacementBatchAsset> assetPage = placementBatchAssetService.page(request); |
| | | response.setAssetList(assetPage.getRecords()); |
| | | response.setTotal(assetPage.getTotal()); |
| | | return response; |
| | | } else { |
| | | Page<PlacementBatchHousehold> householdPage = placementBatchHouseholdService.page(request); |
| | | //填充集体面积、非集体面积 |
| | | if (ObjUtil.isNotEmpty(householdPage.getRecords())) { |
| | | for (PlacementBatchHousehold placementBatchHousehold : householdPage.getRecords()) { |
| | | PlacementApplyRecord record = placementApplyRecordService.getRecordsByCardId(placementBatchHousehold.getIdCard()); |
| | | if (ObjUtil.isNotEmpty(record)) { |
| | | placementBatchHousehold.setOrgArea(record.getOrgArea()); |
| | | placementBatchHousehold.setNoOrgArea(record.getNoOrgArea()); |
| | | } |
| | | } |
| | | } |
| | | response.setHouseholdList(householdPage.getRecords()); |
| | | response.setTotal(householdPage.getTotal()); |
| | | return response; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void dataApprove(PlacementBatchIdRequest request) { |
| | | PlacementBatch placementBatch = this.getById(request.getId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("数据不存在"); |
| | | } |
| | | if(placementBatch.getStatus() != 0){ |
| | | throw new GlobalException("已审核通过!"); |
| | | } |
| | | dataTag(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void assetCheck(IdRequest request) { |
| | | LambdaUpdateWrapper<PlacementBatchAsset> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(PlacementBatchAsset::getChecks,1); |
| | | updateWrapper.set(PlacementBatchAsset::getHouseholdHeadWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getIdCardWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getWaitFamilyAreaWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getTwoPriceWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getPriceAmountWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getCompensationSumWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getQuarterPayAmountWarn,0); |
| | | updateWrapper.set(PlacementBatchAsset::getSubsidyAmountWarn,0); |
| | | |
| | | updateWrapper.eq(PlacementBatchAsset::getId,request.getId()); |
| | | placementBatchAssetService.update(updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void householdCheck(IdRequest request) { |
| | | LambdaUpdateWrapper<PlacementBatchHousehold> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(PlacementBatchHousehold::getChecks,1); |
| | | updateWrapper.set(PlacementBatchHousehold::getHouseholdHeadWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getIdCardWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getWaitFamilyNamesWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getWaitFamilyNamesNoWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getWaitFamilyAreaWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getCompensationAmountWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getCompensationSumWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getQuarterPayAmountWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getSubsidyAmountWarn,0); |
| | | updateWrapper.set(PlacementBatchHousehold::getAreaWarn,0); |
| | | |
| | | updateWrapper.eq(PlacementBatchHousehold::getId,request.getId()); |
| | | placementBatchHouseholdService.update(updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void del(PlacementBatchIdRequest request) { |
| | | this.removeById(request.getId()); |
| | | placementBatchHouseholdService.remove(new LambdaQueryWrapper<PlacementBatchHousehold>(). |
| | | eq(PlacementBatchHousehold::getPlacementBatchId, request.getId())); |
| | | placementBatchAssetService.remove(new LambdaQueryWrapper<PlacementBatchAsset>(). |
| | | eq(PlacementBatchAsset::getPlacementBatchId, request.getId())); |
| | | } |
| | | |
| | | /** |
| | | * 数据标注 |
| | | * @param placementBatch |
| | | */ |
| | | private void dataTag(PlacementBatch placementBatch) { |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | return; |
| | | } |
| | | //数据已经审核过了,不需要标注 |
| | | if (placementBatch.getStatus() != 0) { |
| | | return; |
| | | } |
| | | //资产表 |
| | | List<PlacementBatchAsset> assetRecords = placementBatchAssetService.allList(placementBatch.getId()); |
| | | if (ObjUtil.isNotEmpty(assetRecords)) { |
| | | //去购房表取签订时间、拆迁时间 |
| | | List<String> idsCard = assetRecords.stream().map(PlacementBatchAsset::getIdCard).collect(Collectors.toList()); |
| | | //去申请表取安置人数类型 |
| | | List<PlacementApplyRecord> placementApplyRecords = placementApplyRecordService.getRecordsByCardIds(idsCard); |
| | | //申请表 |
| | | Map<String, PlacementApplyRecord> placementApplyRecordMap = placementApplyRecords.stream() |
| | | .collect(Collectors.toMap( |
| | | PlacementApplyRecord::getIdCard, |
| | | Function.identity(), |
| | | (existing, replacement) -> existing |
| | | )); |
| | | for (PlacementBatchAsset record : assetRecords) { |
| | | if(record.getChecks() == 1){ |
| | | continue; |
| | | } |
| | | //未通过安置申请 |
| | | if (placementApplyRecordService.countPassIdCard(record.getIdCard()) == 0) { |
| | | record.setHouseholdHeadWarn(1); |
| | | }else{ |
| | | record.setHouseholdHeadWarn(0); |
| | | } |
| | | //赔偿金额(判断新购房还是二手房,这两个只能存在一个) |
| | | if (record.getPriceNewAmount().compareTo(BigDecimal.ZERO) == 0 && |
| | | record.getPriceOldAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | record.setPriceAmountWarn(1); |
| | | }else{ |
| | | record.setPriceAmountWarn(0); |
| | | } |
| | | if (record.getPriceNewAmount().compareTo(BigDecimal.ZERO) > 0 && |
| | | record.getPriceOldAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | record.setPriceAmountWarn(1); |
| | | }else{ |
| | | record.setPriceAmountWarn(0); |
| | | } |
| | | //拆迁时间 |
| | | PlacementApplyRecord applyRecord = placementApplyRecordMap.get(record.getIdCard()); |
| | | if (ObjUtil.isEmpty(applyRecord)) { |
| | | continue; |
| | | } |
| | | //自主购房补贴、过渡补贴(如果购房情况异常则不判定自主购房补贴是否异常,自主购房补贴、过渡补贴 依赖赔偿金额信息) |
| | | if (record.getPriceAmountWarn() == 0) { |
| | | boolean warnFlag = compensateService.compensateBuyCalculateV2(applyRecord.getDemolitionTime(), |
| | | record.getStreet(), |
| | | applyRecord.getOrgArea(), applyRecord.getNoOrgArea(), |
| | | record.getPriceNewAmount(), record.getPriceOldAmount(), |
| | | record.getCompensationAmount()); |
| | | record.setCompensationSumWarn(warnFlag ? 0 : 1); |
| | | |
| | | //过渡补贴 |
| | | if (compensateService.compensateSubsidyCalculate(applyRecord.getCurrentCount(), record.getSubsidyAmount())) { |
| | | record.setSubsidyAmountWarn(0); |
| | | }else{ |
| | | record.setSubsidyAmountWarn(1); |
| | | } |
| | | |
| | | //首付款警告 |
| | | boolean downPaymentAmountWarn = true; |
| | | BigDecimal cateAmount = record.getCompensationAmount().multiply(new BigDecimal("0.25")); |
| | | if(cateAmount.compareTo(record.getDownPaymentAmount()) == 0){ |
| | | downPaymentAmountWarn = false; |
| | | } |
| | | record.setDownPaymentAmountWarn(downPaymentAmountWarn ? 1 : 0); |
| | | } |
| | | } |
| | | placementBatchAssetService.updateBatchById(assetRecords); |
| | | } |
| | | |
| | | List<PlacementBatchHousehold> householdsRecords = placementBatchHouseholdService.allList(placementBatch.getId()); |
| | | if (ObjUtil.isNotEmpty(householdsRecords)) { |
| | | for (PlacementBatchHousehold record : householdsRecords) { |
| | | if(record.getChecks() == 1){ |
| | | continue; |
| | | } |
| | | //未通过安置申请 |
| | | int pass = placementApplyRecordService.countPassIdCard(record.getIdCard()); |
| | | if (pass == 0) { |
| | | record.setHouseholdHeadWarn(1); |
| | | }else{ |
| | | record.setHouseholdHeadWarn(0); |
| | | } |
| | | //不在安置库 |
| | | int noSettle = placementService.countPlacementByIdCard(record.getIdCard()); |
| | | if ( noSettle == 0) { |
| | | record.setIdCardWarn(1); |
| | | }else{ |
| | | record.setIdCardWarn(0); |
| | | } |
| | | //判断家庭成员是否重复 |
| | | if (ObjUtil.isNotEmpty(record.getWaitFamilyNames())) { |
| | | boolean familyNameWarn = false; |
| | | boolean familyNoWarn = false; |
| | | String[] familyNames = record.getWaitFamilyNames().split("、"); |
| | | if (ObjUtil.isNotEmpty(familyNames)) { |
| | | //判断是否在安置库 =0不在安置库 |
| | | for (String familyName : familyNames) { |
| | | if (placementService.countNamesExists(familyName) ==0) { |
| | | familyNoWarn = true; |
| | | break; |
| | | } |
| | | } |
| | | //判断重复 |
| | | for(String familyName : familyNames){ |
| | | int exists = selectNameExists(familyName); |
| | | if (exists > 1) { |
| | | familyNameWarn = true; |
| | | break; |
| | | } |
| | | } |
| | | record.setWaitFamilyNamesWarn(familyNameWarn ? 1 : 0); |
| | | record.setWaitFamilyNamesNoWarn(familyNoWarn ? 1 : 0); |
| | | } |
| | | } |
| | | //应安置面积警告标注 |
| | | boolean warn = true; |
| | | BigDecimal waitFamilyArea = record.getWaitFamilyArea(); |
| | | // Integer currentCollectiveNum = record.getCurrentCollectiveNum(); |
| | | // Integer currentNoCollectiveNum = record.getCurrentNoCollectiveNum(); |
| | | //查询申请表 面积 |
| | | PlacementApplyRecord placementApplyRecord = placementApplyRecordService.getRecordsByCardId(record.getIdCard()); |
| | | if (ObjUtil.isEmpty(placementApplyRecord)) { |
| | | warn = false; |
| | | }else { |
| | | warn = compensateService.compensateSettleAreaCalculate(placementApplyRecord.getOrgArea(), placementApplyRecord.getNoOrgArea(), waitFamilyArea); |
| | | } |
| | | record.setWaitFamilyAreaWarn(warn ? 0 : 1); |
| | | |
| | | //赔偿金额(判断新购房还是二手房,这两个只能存在一个) |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) == 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | | } |
| | | if (record.getCompensationNewAmount().compareTo(BigDecimal.ZERO) > 0 && |
| | | record.getCompensationOldAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | record.setCompensationAmountWarn(1); |
| | | }else{ |
| | | record.setCompensationAmountWarn(0); |
| | | } |
| | | BigDecimal orgArea = placementApplyRecord == null ? BigDecimal.ZERO : placementApplyRecord.getOrgArea(); |
| | | BigDecimal noOrgArea = placementApplyRecord == null ? BigDecimal.ZERO : placementApplyRecord.getNoOrgArea(); |
| | | //自主购房补贴、过渡补贴(如果购房情况异常则不判定自主购房补贴是否异常,自主购房补贴、过渡补贴 依赖赔偿金额信息) |
| | | if (record.getCompensationAmountWarn() == 0) { |
| | | boolean warnFlag = compensateService.compensateBuyCalculateV2(record.getDemolitionTime(), |
| | | record.getStreet(), |
| | | orgArea, noOrgArea, |
| | | record.getCompensationNewAmount(), record.getCompensationOldAmount(), |
| | | record.getCompensationSum()); |
| | | record.setCompensationSumWarn(warnFlag ? 0 : 1); |
| | | |
| | | //过渡补贴 |
| | | if (compensateService.compensateSubsidyCalculate(record.getCurrentCount(), record.getSubsidyAmount())) { |
| | | record.setSubsidyAmountWarn(0); |
| | | }else{ |
| | | record.setSubsidyAmountWarn(1); |
| | | } |
| | | } |
| | | |
| | | //每季度支付款项 |
| | | BigDecimal pay = record.getCompensationSum().multiply(new BigDecimal("0.25")); |
| | | BigDecimal quarterPayAmount = (record.getCompensationSum().subtract(pay)).divide(new BigDecimal("20"), 10, RoundingMode.DOWN); |
| | | if (quarterPayAmount.compareTo(record.getQuarterPayAmount()) != 0) { |
| | | record.setQuarterPayAmountWarn(1); |
| | | }else{ |
| | | record.setQuarterPayAmountWarn(0); |
| | | } |
| | | //首付款警告 |
| | | boolean downPaymentAmountWarn = true; |
| | | BigDecimal cateAmount = record.getCompensationSum().multiply(new BigDecimal("0.25")); |
| | | if(cateAmount.compareTo(record.getDownPaymentAmount()) == 0){ |
| | | downPaymentAmountWarn = false; |
| | | } |
| | | record.setDownPaymentAmountWarn(downPaymentAmountWarn ? 1 : 0); |
| | | //房源 |
| | | BigDecimal area; |
| | | if(record.getOldHousingArea().compareTo(BigDecimal.ZERO) > 0){ |
| | | area = record.getOldHousingArea(); |
| | | }else if(record.getBuildHousingArea().compareTo(BigDecimal.ZERO) > 0){ |
| | | area = record.getBuildHousingArea(); |
| | | }else{ |
| | | area = record.getNewHousingArea(); |
| | | } |
| | | if(compensateService.houseCalculate(record.getCurrentCount(),area)){ |
| | | record.setAreaWarn(1); |
| | | }else{ |
| | | record.setAreaWarn(0); |
| | | } |
| | | } |
| | | placementBatchHouseholdService.updateBatchById(householdsRecords); |
| | | } |
| | | } |
| | | |
| | | public Integer selectNameExists(String name) { |
| | | //排除驳回的数据 |
| | | LambdaQueryWrapper<PlacementBatch> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.ne(PlacementBatch::getStatus,2); |
| | | List<PlacementBatch> batches = this.list(queryWrapper); |
| | | if (ObjUtil.isEmpty(batches)) { |
| | | return 0; |
| | | } |
| | | List<Long> batchIds = batches.stream().map(PlacementBatch::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<PlacementBatchHousehold> childQueryWrapper = new LambdaQueryWrapper<>(); |
| | | childQueryWrapper.in(PlacementBatchHousehold::getPlacementBatchId,batchIds); |
| | | childQueryWrapper.and(query->query.like(PlacementBatchHousehold::getWaitFamilyNames,name)); |
| | | return NumberUtil.parseInt(String.valueOf(placementBatchHouseholdService.count(childQueryWrapper))); |
| | | } |
| | | |
| | | @Override |
| | | public void assetEdit(PlacementBatchAsset request) { |
| | | PlacementBatch placementBatch = this.getById(request.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchAssetService.updateById(request); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | dataTag(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void householdEdit(PlacementBatchHousehold request) { |
| | | PlacementBatch placementBatch = this.getById(request.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchHouseholdService.updateById(request); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | dataTag(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void assetDel(IdRequest request) { |
| | | PlacementBatchAsset placementBatchAsset = placementBatchAssetService.getById(request.getId()); |
| | | if (ObjUtil.isEmpty(placementBatchAsset)) { |
| | | throw new GlobalException("记录不存在!"); |
| | | } |
| | | PlacementBatch placementBatch = this.getById(placementBatchAsset.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchAssetService.removeById(request.getId()); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void householdDel(IdRequest request) { |
| | | PlacementBatchHousehold placementBatchHousehold = placementBatchHouseholdService.getById(request.getId()); |
| | | if(ObjUtil.isEmpty(placementBatchHousehold)){ |
| | | throw new GlobalException("记录不存在!"); |
| | | } |
| | | PlacementBatch placementBatch = this.getById(placementBatchHousehold.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchHouseholdService.removeById(request.getId()); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void householdAdd(PlacementBatchHousehold request) { |
| | | PlacementBatch placementBatch = this.getById(request.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchHouseholdService.save(request); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public void assetAdd(PlacementBatchAsset request) { |
| | | PlacementBatch placementBatch = this.getById(request.getPlacementBatchId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | placementBatchAssetService.save(request); |
| | | //调整汇总信息 |
| | | sumPlacementBatch(placementBatch); |
| | | } |
| | | |
| | | @Override |
| | | public PlacementBatchAsset assetDetail(IdRequest request) { |
| | | return placementBatchAssetService.getById(request.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public PlacementBatchHousehold householdDetail(IdRequest request) { |
| | | return placementBatchHouseholdService.getById(request.getId()); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void approve(ApproveRequest request) { |
| | | PlacementBatch placementBatch = this.getById(request.getId()); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次不存在!"); |
| | | } |
| | | if (placementBatch.getStatus() != 0) { |
| | | throw new GlobalException("已经审核过了"); |
| | | } |
| | | placementBatch.setStatus(request.getStatus()); |
| | | placementBatch.setReason(request.getReason()); |
| | | placementBatch.setApproveTime(new Date()); |
| | | placementBatch.setApproveId(SecurityUtils.getUserId()); |
| | | placementBatch.setApproveName(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | updateById(placementBatch); |
| | | //记录审核周期 |
| | | buildCycleTime(placementBatch.getId()); |
| | | |
| | | //审核通过,修改待安置库状态 |
| | | if(request.getStatus() == 1) { |
| | | LambdaQueryWrapper<PlacementBatchHousehold> placementApplyRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | placementApplyRecordLambdaQueryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId, placementBatch.getId()); |
| | | //家庭成员 |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.list(placementApplyRecordLambdaQueryWrapper); |
| | | //户主 |
| | | List<String> houseHead = households.stream().map(PlacementBatchHousehold::getHouseholdHead).collect(Collectors.toList()); |
| | | if (ObjUtil.isNotEmpty(households)) { |
| | | List<String> familyNames = households.stream().map(PlacementBatchHousehold::getWaitFamilyNames).collect(Collectors.toList()); |
| | | List<String> allFamilyNames = new ArrayList<>(); |
| | | for(String familyName : familyNames) { |
| | | List<String> names = Arrays.asList(familyName.split("、")); |
| | | allFamilyNames.addAll(names); |
| | | } |
| | | LambdaUpdateWrapper<Placement> placementLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | placementLambdaUpdateWrapper.set(Placement::getStatus, 1); |
| | | placementLambdaUpdateWrapper.and(query -> query.in(Placement::getFamilyName, allFamilyNames)); |
| | | placementService.update(placementLambdaUpdateWrapper); |
| | | |
| | | LambdaUpdateWrapper<Placement> placementHouseHeadUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | placementHouseHeadUpdateWrapper.set(Placement::getStatus, 1); |
| | | placementHouseHeadUpdateWrapper.and(query -> query.in(Placement::getHouseholdHead, houseHead)); |
| | | placementService.update(placementHouseHeadUpdateWrapper); |
| | | } |
| | | } |
| | | |
| | | //同步待处理消息 |
| | | new Thread(() -> { |
| | | syncApplyMessage(); |
| | | }).start(); |
| | | } |
| | | |
| | | /** |
| | | * 生成付款周期 |
| | | * @param placementBatchId |
| | | */ |
| | | private void buildCycleTime(Long placementBatchId){ |
| | | List<PlacementBatchHousehold> records = placementBatchHouseholdService.allList(placementBatchId); |
| | | if (ObjUtil.isEmpty(records)) { |
| | | return; |
| | | } |
| | | for(PlacementBatchHousehold placementBatchHousehold : records){ |
| | | if(ObjUtil.isEmpty(placementBatchHousehold.getCompensationPayTime())){ |
| | | continue; |
| | | } |
| | | String cycleTimes = PaymentCycleHelper.getQuarterlyPaymentCycles(placementBatchHousehold.getCompensationPayTime()); |
| | | placementBatchHousehold.setCycle(cycleTimes); |
| | | } |
| | | placementBatchHouseholdService.updateBatchById(records); |
| | | } |
| | | |
| | | @Override |
| | | public void problemExport(ProblemExportRequest request, HttpServletResponse response) { |
| | | try { |
| | | PlacementBatch placementBatch = getById(request.getPlacementBatchId()); |
| | | //查询安置表是否存在 |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | throw new GlobalException("安置批次信息不存在"); |
| | | } |
| | | FileUtils.setExcelResponseHeader(response, "问题数据.xlsx"); |
| | | //资金表 |
| | | if (request.getType() == 1) { |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), AssetExportResponse.class); |
| | | List<PlacementBatchAsset> assets = placementBatchAssetService.problemList(request); |
| | | List<AssetExportResponse> data = BeanUtil.copyToList(assets, AssetExportResponse.class); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } else { |
| | | ExcelWriterBuilder write = EasyExcelFactory.write(response.getOutputStream(), HouseholdExportResponse.class); |
| | | //购房表 |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.problemList(request); |
| | | List<HouseholdExportResponse> data = BeanUtil.copyToList(households, HouseholdExportResponse.class); |
| | | write.sheet("sheet").doWrite(data); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new GlobalException("导出问题数据失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取最近批次号 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getLastBatchNumber() { |
| | | LambdaQueryWrapper<PlacementBatch> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.orderByDesc(PlacementBatch::getId); |
| | | wrapper.last("limit 1"); |
| | | PlacementBatch placementBatch = baseMapper.selectOne(wrapper); |
| | | if (ObjUtil.isEmpty(placementBatch)) { |
| | | return null; |
| | | } |
| | | return placementBatch.getBatchNumber(); |
| | | } |
| | | |
| | | @Override |
| | | public SelfBuyResponse getSelfBuyResponse() { |
| | | SelfBuyResponse selfBuyResponse = new SelfBuyResponse(); |
| | | LambdaQueryWrapper<PlacementBatch> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatch::getStatus,1); |
| | | List<PlacementBatch> batches = list(queryWrapper); |
| | | if (ObjUtil.isEmpty(batches)) { |
| | | return selfBuyResponse; |
| | | } |
| | | Integer householdCount = batches.stream().mapToInt(PlacementBatch::getHouseholdsNum).sum(); |
| | | Integer personCount = batches.stream().mapToInt(PlacementBatch::getPersonNum).sum(); |
| | | selfBuyResponse.setHouseholdNum(householdCount); |
| | | selfBuyResponse.setPersonNum(personCount); |
| | | return selfBuyResponse; |
| | | } |
| | | |
| | | @Override |
| | | public List<StreetResponse> getStreetResponse() { |
| | | return placementBatchHouseholdService.getStreetResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ImportErrorResponse> getImportErrorResponse() { |
| | | return placementBatchHouseholdService.getImportErrorResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MapResponse> getMapResponse() { |
| | | return placementBatchHouseholdService.getMapResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<QuarterProcessResponse> getQuarterProcessResponse(ReportRequest request) { |
| | | return placementBatchHouseholdService.getQuarterProcessResponse(request); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlacementTypeResponse> getPlacementTypeResponse() { |
| | | return placementBatchHouseholdService.getPlacementTypeResponse(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthCompensationResponse> getMonthCompensationResponses(String month) { |
| | | return placementBatchHouseholdService.getMonthCompensationResponse(month); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String,Object>> getQuarterPayResponse(List<String> quarters) { |
| | | return placementBatchHouseholdService.getQuarterPayResponse(quarters); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 资金表导入 |
| | | * |
| | | * @param assetFile |
| | | * @throws IOException |
| | | */ |
| | | public void importAsset(Long placementBatchId, MultipartFile assetFile) { |
| | | File file = FileUtils.convertToFile(assetFile); |
| | | List<Map<Integer, String>> maps = FileUtils.readExcelHead(file); |
| | | if (!Objects.equals(maps.get(0).get(0), "镇(街道)") |
| | | || !Objects.equals(maps.get(0).get(1), "拆迁项目名称") |
| | | || !Objects.equals(maps.get(0).get(2), "所在村(社区)") |
| | | || !Objects.equals(maps.get(0).get(3), "户主姓名") |
| | | || !Objects.equals(maps.get(0).get(4), "身份证号") |
| | | || !Objects.equals(maps.get(0).get(5), "应安置人数(人)") |
| | | || !Objects.equals(maps.get(0).get(6), "所有家庭人员应安置面积(m²)") |
| | | ) { |
| | | throw new GlobalException("Excel表头格式不对"); |
| | | } |
| | | List<PlacementAssetTemplateResponse> dataList; |
| | | try { |
| | | dataList = EasyExcelFactory.read(file) |
| | | .head(PlacementAssetTemplateResponse.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | } catch (Exception e) { |
| | | throw new GlobalException("读取Excel文件失败"); |
| | | } |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | | throw new GlobalException("未解析出数据"); |
| | | } |
| | | |
| | | //导入数据,直接导入库 |
| | | List<PlacementBatchAsset> records = BeanUtil.copyToList(dataList, PlacementBatchAsset.class); |
| | | //校验数据(身份证必填) |
| | | for (PlacementBatchAsset record : records) { |
| | | record.setPlacementBatchId(placementBatchId); |
| | | if (ObjUtil.isEmpty(record.getIdCard())) { |
| | | throw new GlobalException(record.getHouseholdHead() + "身份证不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getProjectName())) { |
| | | throw new GlobalException("请输入拆迁项目名称"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getStreet())) { |
| | | throw new GlobalException("请输入镇(街道)"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getCommunity())) { |
| | | throw new GlobalException("请输入社区"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getHouseholdHead())) { |
| | | throw new GlobalException("请输入户主"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getResettledNum())) { |
| | | throw new GlobalException("请输入应安置人数"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getResettledArea())) { |
| | | throw new GlobalException("请输入所有家庭人员应安置面积"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getCompensationAmount())) { |
| | | throw new GlobalException("请输入补偿总价"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getDownPaymentAmount())) { |
| | | throw new GlobalException("请输入25%首付款"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getQuarterPayAmount())) { |
| | | throw new GlobalException("请输入每季度需支付款项"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getSubsidyAmount())) { |
| | | throw new GlobalException("请输入过渡补贴"); |
| | | } |
| | | } |
| | | placementBatchAssetService.saveBatch(records); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 购房表导入 |
| | | * |
| | | * @param householdFile |
| | | * @throws IOException |
| | | */ |
| | | public void importHousehold(Long placementBatchId, MultipartFile householdFile) { |
| | | File file = FileUtils.convertToFile(householdFile); |
| | | List<Map<Integer, String>> maps = FileUtils.readExcelHead(file); |
| | | if (!Objects.equals(maps.get(0).get(0), "镇(街道)") |
| | | || !Objects.equals(maps.get(0).get(1), "拆迁项目名称") |
| | | || !Objects.equals(maps.get(0).get(2), "所在村(社区)") |
| | | || !Objects.equals(maps.get(0).get(3), "拆迁时间") |
| | | || !Objects.equals(maps.get(0).get(4), "户主姓名") |
| | | || !Objects.equals(maps.get(0).get(5), "身份证号") |
| | | || !Objects.equals(maps.get(0).get(6), "联系电话") |
| | | ) { |
| | | throw new GlobalException("Excel表头格式不对"); |
| | | } |
| | | List<PlacementHouseholdTemplateResponse> dataList = EasyExcelFactory.read(file) |
| | | .head(PlacementHouseholdTemplateResponse.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | | throw new GlobalException("未解析出数据"); |
| | | } |
| | | |
| | | //导入数据,直接导入库 |
| | | List<PlacementBatchHousehold> records = BeanUtil.copyToList(dataList, PlacementBatchHousehold.class); |
| | | //校验数据(身份证必填) |
| | | for (PlacementBatchHousehold record : records) { |
| | | record.setPlacementBatchId(placementBatchId); |
| | | if (ObjUtil.isEmpty(record.getIdCard())) { |
| | | throw new GlobalException(record.getHouseholdHead() + "身份证不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getStreet())) { |
| | | throw new GlobalException("请输入街道"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getCommunity())) { |
| | | throw new GlobalException("请输入所在村(社区)"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getProjectName())) { |
| | | throw new GlobalException("请输入项目名称"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getDemolitionTime())) { |
| | | throw new GlobalException("请输入拆迁时间"); |
| | | } |
| | | if (ObjUtil.isEmpty(record.getHouseholdHead())) { |
| | | throw new GlobalException("请输入户主名称"); |
| | | } |
| | | // if (ObjUtil.isEmpty(record.getMobile())) { |
| | | // throw new GlobalException("请输入联系电话"); |
| | | // } |
| | | if(ObjUtil.isEmpty(record.getCurrentCount())){ |
| | | throw new GlobalException("请输入本次安置人数 - 合计"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getWaitFamilyNames())){ |
| | | throw new GlobalException("请输入待安置家庭成员"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getWaitFamilyArea())){ |
| | | throw new GlobalException("请输入待安置人员应安置面积合计"); |
| | | } |
| | | // if(ObjUtil.isEmpty(record.getWaitFamilyArea())){ |
| | | // throw new GlobalException("请输入待安置人员应安置面积合计"); |
| | | // } |
| | | if(ObjUtil.isEmpty(record.getCompensationSum())){ |
| | | throw new GlobalException("请输入补偿金额 - 合计"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getDownPaymentAmount())){ |
| | | throw new GlobalException("25%首付款"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getQuarterPayAmount())){ |
| | | throw new GlobalException("每季度需支付款项"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getSubsidyAmount())){ |
| | | throw new GlobalException("过渡补贴"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getCertificateTime())){ |
| | | throw new GlobalException("凭证发放时间"); |
| | | } |
| | | if(ObjUtil.isEmpty(record.getBuyTime())){ |
| | | throw new GlobalException("购房时间"); |
| | | } |
| | | // if(ObjUtil.isEmpty(record.getDealAmount())){ |
| | | // throw new GlobalException("成交金额"); |
| | | // } |
| | | if(ObjUtil.isEmpty(record.getSignTime())){ |
| | | throw new GlobalException("自主购房签订时间"); |
| | | } |
| | | // if(ObjUtil.isEmpty(record.getSignTime())){ |
| | | // throw new GlobalException("自主购房签订时间"); |
| | | // } |
| | | // if(ObjUtil.isEmpty(record.getCompensationPayTime())){ |
| | | // throw new GlobalException("25%补偿款及过渡补贴支付时间"); |
| | | // } |
| | | } |
| | | placementBatchHouseholdService.saveBatch(records); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算汇总安置批次信息 |
| | | */ |
| | | private void sumPlacementBatch(PlacementBatch placementBatch) { |
| | | //汇总资金表 |
| | | LambdaQueryWrapper<PlacementBatchAsset> assetLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | assetLambdaQueryWrapper.eq(PlacementBatchAsset::getPlacementBatchId, placementBatch.getId()); |
| | | List<PlacementBatchAsset> assets = placementBatchAssetService.list(assetLambdaQueryWrapper); |
| | | if (CollectionUtils.isNotEmpty(assets)) { |
| | | // 申请总户数 |
| | | Integer householdsNum = Math.toIntExact(assets.stream().map(PlacementBatchAsset::getIdCard).distinct().count()); |
| | | //申请总人数 |
| | | Integer personNum = assets.stream().mapToInt(PlacementBatchAsset::getResettledNum).sum(); |
| | | //25%首付款 |
| | | BigDecimal downPaymentAmount = assets.stream().map(PlacementBatchAsset::getDownPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //每季度需支付款项(万元) |
| | | BigDecimal quarterPayAmount = assets.stream().map(PlacementBatchAsset::getQuarterPayAmount).reduce(BigDecimal.ZERO, BigDecimal::add).multiply(new BigDecimal("20")); |
| | | //过渡补贴(万元) |
| | | BigDecimal subsidyAmount = assets.stream().map(PlacementBatchAsset::getSubsidyAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //补偿金额(合计) |
| | | BigDecimal totalAmount = assets.stream().map(PlacementBatchAsset::getCompensationAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | placementBatch.setHouseholdsNum(householdsNum); |
| | | placementBatch.setPersonNum(personNum); |
| | | placementBatch.setDownPaymentAmount(downPaymentAmount); |
| | | placementBatch.setQuarterPayAmount(quarterPayAmount); |
| | | placementBatch.setSubsidyAmount(subsidyAmount); |
| | | placementBatch.setTotalAmount(totalAmount); |
| | | } |
| | | |
| | | //汇总房产表 |
| | | LambdaQueryWrapper<PlacementBatchHousehold> householdLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | householdLambdaQueryWrapper.eq(PlacementBatchHousehold::getPlacementBatchId, placementBatch.getId()); |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.list(householdLambdaQueryWrapper); |
| | | if (CollectionUtils.isNotEmpty(households)) { |
| | | //汇总面积 |
| | | //新建商品住房-面积 |
| | | BigDecimal newHousingArea = households.stream().map(PlacementBatchHousehold::getNewHousingArea).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //二手住房-面积 |
| | | BigDecimal oldHousingArea = households.stream().map(PlacementBatchHousehold::getOldHousingArea).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //新建商业住房 |
| | | BigDecimal buildHousingArea = households.stream().map(PlacementBatchHousehold::getBuildHousingArea).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //新建停车位-金额(万元) |
| | | Integer newStopArea = households.stream().mapToInt(PlacementBatchHousehold::getNewStopNum).sum(); |
| | | |
| | | placementBatch.setNewArea(newHousingArea); |
| | | placementBatch.setOldArea(oldHousingArea); |
| | | placementBatch.setBusinessArea(buildHousingArea); |
| | | placementBatch.setParkingArea(newStopArea); |
| | | } |
| | | //修改 |
| | | updateById(placementBatch); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.PlacementError; |
| | | import com.ruoyi.bussiness.mapper.PlacementErrorMapper; |
| | | import com.ruoyi.bussiness.object.request.error.ErrorPageRequest; |
| | | import com.ruoyi.bussiness.object.response.error.ErrorPageResponse; |
| | | import com.ruoyi.bussiness.service.PlacementErrorService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlacementErrorServiceImpl extends ServiceImpl<PlacementErrorMapper, PlacementError> implements PlacementErrorService { |
| | | |
| | | private final PlacementErrorMapper placementErrorMapper; |
| | | |
| | | public PlacementErrorServiceImpl(PlacementErrorMapper placementErrorMapper) { |
| | | this.placementErrorMapper = placementErrorMapper; |
| | | } |
| | | |
| | | @Override |
| | | public ErrorPageResponse page(ErrorPageRequest request) { |
| | | // LambdaQueryWrapper<PlacementError> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // if (ObjUtil.isNotEmpty(request.getStreet())) { |
| | | // queryWrapper.eq(PlacementError::getStreet, request.getStreet()); |
| | | // } |
| | | Page<PlacementError> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<PlacementError> pageList = baseMapper.page(page, request); |
| | | ErrorPageResponse errorPageResponse = new ErrorPageResponse(); |
| | | errorPageResponse.setRecords(pageList.getRecords()); |
| | | errorPageResponse.setTotal(page.getTotal()); |
| | | return errorPageResponse; |
| | | } |
| | | |
| | | @Override |
| | | public PlacementError getErrorByStreet(String street) { |
| | | if (ObjUtil.isEmpty(street)) { |
| | | return null; |
| | | } |
| | | LambdaQueryWrapper<PlacementError> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementError::getStreet, street); |
| | | List<PlacementError> error = baseMapper.selectList(queryWrapper); |
| | | if (ObjUtil.isEmpty(error)) { |
| | | PlacementError placementError = new PlacementError(); |
| | | placementError.setStreet(street); |
| | | placementErrorMapper.insert(placementError); |
| | | return placementError; |
| | | } |
| | | return error.get(0); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.bussiness.domain.Placement; |
| | | import com.ruoyi.bussiness.domain.PlacementBatchHousehold; |
| | | import com.ruoyi.bussiness.mapper.PlacementMapper; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementIdRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementImportRequest; |
| | | import com.ruoyi.bussiness.object.request.placement.PlacementPageRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.GetHouseHistoryRequest; |
| | | import com.ruoyi.bussiness.object.response.placement.PlacementPageResponse; |
| | | import com.ruoyi.bussiness.object.response.placement.PlacementTemplateResponse; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import com.ruoyi.bussiness.service.PlacementService; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class PlacementServiceImpl extends ServiceImpl<PlacementMapper, Placement> implements PlacementService { |
| | | |
| | | @Lazy |
| | | @Autowired |
| | | private PlacementBatchHouseholdService placementBatchHouseholdService; |
| | | |
| | | @Override |
| | | public PlacementPageResponse page(PlacementPageRequest request) { |
| | | Page<Placement> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ObjUtil.isNotEmpty(request.getStreet())){ |
| | | queryWrapper.like(Placement::getStreet,request.getStreet()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getProjectName())){ |
| | | queryWrapper.like(Placement::getProjectName,request.getProjectName()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getCommunity())){ |
| | | queryWrapper.like(Placement::getCommunity,request.getCommunity()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getHeadOrIdCard())){ |
| | | queryWrapper.and(query->query.like(Placement::getHouseholdHead,request.getHeadOrIdCard()).or().like(Placement::getIdCard,request.getHeadOrIdCard())); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getStatus())){ |
| | | queryWrapper.eq(Placement::getStatus,request.getStatus()); |
| | | } |
| | | if(ObjUtil.isNotEmpty(request.getFamilyNames())){ |
| | | queryWrapper.like(Placement::getFamilyName,request.getFamilyNames()); |
| | | } |
| | | Page<Placement> pageResponse = this.baseMapper.selectPage(page, queryWrapper); |
| | | PlacementPageResponse response = new PlacementPageResponse(); |
| | | response.setTotal(pageResponse.getTotal()); |
| | | response.setRecords(pageResponse.getRecords()); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public void add(Placement placement) { |
| | | //查询是否唯一 |
| | | int i = this.countPlacementByFamilyIdCard(placement.getFamilyIdCard()); |
| | | if (i > 1) { |
| | | throw new GlobalException(placement.getFamilyIdCard() + "家庭成员身份证号已存在!"); |
| | | } |
| | | this.save(placement); |
| | | } |
| | | |
| | | @Override |
| | | public void update(Placement placement) { |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Placement::getFamilyIdCard, placement.getFamilyIdCard()); |
| | | queryWrapper.ne(Placement::getId,placement.getId()); |
| | | List<Placement> oldPlacements = this.baseMapper.selectList(queryWrapper); |
| | | if (!oldPlacements.isEmpty()) { |
| | | throw new GlobalException(placement.getIdCard() + "身份证号已存在!"); |
| | | } |
| | | this.updateById(placement); |
| | | } |
| | | |
| | | @Override |
| | | public Placement detail(PlacementIdRequest request) { |
| | | Placement placement = this.baseMapper.selectById(request.getId()); |
| | | GetHouseHistoryRequest getHouseHistoryRequest = new GetHouseHistoryRequest(); |
| | | getHouseHistoryRequest.setFamilyIdCard(placement.getFamilyIdCard()); |
| | | getHouseHistoryRequest.setFamilyName(placement.getFamilyName()); |
| | | List<PlacementBatchHousehold> households = placementBatchHouseholdService.getHouseHistory(getHouseHistoryRequest); |
| | | placement.setHouseholds(households); |
| | | return placement; |
| | | } |
| | | |
| | | @Override |
| | | public void del(PlacementIdRequest request) { |
| | | this.baseMapper.deleteById(request.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public void imports(PlacementImportRequest request) { |
| | | File file = FileUtils.convertToFile(request.getFile()); |
| | | List<Map<Integer, String>> maps = FileUtils.readExcelHead(file); |
| | | if (!Objects.equals(maps.get(0).get(0), "项目名称") |
| | | || !Objects.equals(maps.get(0).get(1), "项目启动时间") |
| | | || !Objects.equals(maps.get(0).get(2), "镇街") |
| | | || !Objects.equals(maps.get(0).get(3), "村社区") |
| | | || !Objects.equals(maps.get(0).get(4), "组") |
| | | || !Objects.equals(maps.get(0).get(5), "户主姓名") |
| | | || !Objects.equals(maps.get(0).get(6), "身份证号码") |
| | | ) { |
| | | throw new GlobalException("Excel表头格式不对"); |
| | | } |
| | | List<PlacementTemplateResponse> dataList; |
| | | try { |
| | | dataList = EasyExcelFactory.read(file) |
| | | .head(PlacementTemplateResponse.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new GlobalException(e.getMessage()); |
| | | } |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | | throw new GlobalException("未解析出数据"); |
| | | } |
| | | List<String> idCards = new ArrayList<>(); |
| | | for (PlacementTemplateResponse data : dataList) { |
| | | if (ObjUtil.isEmpty(data.getIdCard()) |
| | | || ObjUtil.isEmpty(data.getFamilyIdCard())) { |
| | | throw new GlobalException("导入数据户主和家庭成员身份证号码不能为空!"); |
| | | } |
| | | if(ObjUtil.isEmpty(data.getProjectName())){ |
| | | throw new GlobalException("导入数据项目名称不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getStartTime())) { |
| | | throw new GlobalException("导入数据项目启动时间不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getStreet())) { |
| | | throw new GlobalException("导入数据镇不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getHouseholdHead())) { |
| | | throw new GlobalException("导入数据户主不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getFamilyName())) { |
| | | throw new GlobalException("导入数据家庭成员不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getRelation())) { |
| | | throw new GlobalException("导入数据关系不能为空!"); |
| | | } |
| | | if (ObjUtil.isEmpty(data.getPersonType())) { |
| | | throw new GlobalException("导入数据人员性质不能为空!"); |
| | | } |
| | | |
| | | // if (ObjUtil.isEmpty(data.getAge())) { |
| | | // throw new GlobalException("导入数据年龄不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getSex())) { |
| | | // throw new GlobalException("导入数据性别不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getBirthday())) { |
| | | // throw new GlobalException("导入数据出生年月不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getWays())) { |
| | | // throw new GlobalException("导入数据安置方式不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getMobile())) { |
| | | // throw new GlobalException("导入数据联系方式不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getOriginCollectionTime())) { |
| | | // throw new GlobalException("导入数据原始拆迁过渡时间不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getLastBeginTime())) { |
| | | // throw new GlobalException("导入数据上次过渡时间不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getLastEndTime())) { |
| | | // throw new GlobalException("导入数据上次过渡发放时间不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getNoHouseArea())) { |
| | | // throw new GlobalException("导入数据剩余未安置面积不能为空!"); |
| | | // } |
| | | // if (ObjUtil.isEmpty(data.getNoShopArea())) { |
| | | // throw new GlobalException("导入数据剩余未安置商铺面积不能为空!"); |
| | | // } |
| | | idCards.add(data.getFamilyIdCard()); |
| | | } |
| | | List<Placement> exists = selectPlacementIdCard(idCards); |
| | | if (ObjUtil.isNotEmpty(exists)) { |
| | | String ids = exists.stream().map(Placement::getFamilyIdCard).collect(Collectors.joining(",")); |
| | | throw new GlobalException("身份证已存在:" + ids); |
| | | } |
| | | |
| | | List<Placement> placements = BeanUtil.copyToList(dataList, Placement.class); |
| | | this.saveBatch(placements); |
| | | } |
| | | |
| | | @Override |
| | | public int countPlacementByFamilyIdCard(String familyIdCard) { |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Placement::getFamilyIdCard,familyIdCard); |
| | | return this.baseMapper.selectCount(queryWrapper).intValue(); |
| | | } |
| | | |
| | | @Override |
| | | public int countPlacementByIdCard(String idCard) { |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Placement::getIdCard,idCard); |
| | | return this.baseMapper.selectCount(queryWrapper).intValue(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Placement> selectPlacementIdCard(List<String> idCard) { |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(Placement::getFamilyIdCard,idCard); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public int countNamesExists(String name) { |
| | | LambdaQueryWrapper<Placement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(Placement::getFamilyName,name.trim()); |
| | | return this.baseMapper.selectCount(queryWrapper).intValue(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; |
| | | import cn.hutool.core.io.resource.ClassPathResource; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.metadata.fill.FillConfig; |
| | | import com.ruoyi.bussiness.object.request.report.DetailExportsRequest; |
| | | import com.ruoyi.bussiness.object.request.report.DetailPageRequest; |
| | | import com.ruoyi.bussiness.object.request.report.ReportPageRequest; |
| | | import com.ruoyi.bussiness.object.response.report.*; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import com.ruoyi.bussiness.service.ReportService; |
| | | import com.ruoyi.bussiness.utils.PaymentCycleHelper; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class ReportServiceImpl implements ReportService { |
| | | |
| | | @Autowired |
| | | private PlacementBatchHouseholdService placementBatchHouseholdService; |
| | | |
| | | @Override |
| | | public ReportPageResponse page(ReportPageRequest request) { |
| | | //生成季度 |
| | | List<String> quarters = PaymentCycleHelper.getQuarterlyPaymentCyclesList(new Date()); |
| | | request.setQuarters(quarters); |
| | | |
| | | ReportPageResponse response = placementBatchHouseholdService.reportPage(request); |
| | | //汇总数据 |
| | | ReportSumResponse reportSumResponse = placementBatchHouseholdService.sumHousehold(request.getStreet()); |
| | | response.setReportSumResponse(reportSumResponse); |
| | | response.setQuarters(quarters); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public DetailPageResponse detail(DetailPageRequest request) { |
| | | ReportSumResponse reportSumResponse = placementBatchHouseholdService.sumHousehold(request.getStreet()); |
| | | |
| | | DetailPageResponse response = placementBatchHouseholdService.detailPage(request); |
| | | response.setReportSumResponse(reportSumResponse); |
| | | if(ObjUtil.isEmpty(response.getRecords())){ |
| | | return response; |
| | | } |
| | | for(DetailResponse item : response.getRecords()){ |
| | | if(ObjUtil.isNotEmpty(item.getCompensationPayTime())){ |
| | | String cycle = PaymentCycleHelper.getFirstPaymentCycle(item.getCompensationPayTime()); |
| | | item.setCycle(cycle); |
| | | } |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public void exports(DetailExportsRequest request, HttpServletResponse response) throws IOException { |
| | | // 1. 读取模板 |
| | | ClassPathResource resource = new ClassPathResource("templates/bjd.xlsx"); |
| | | InputStream templateFile = resource.getStream(); |
| | | |
| | | // 2. 创建输出流 |
| | | ByteArrayOutputStream out = new ByteArrayOutputStream(); |
| | | |
| | | try (ExcelWriter writer = EasyExcel.write(out).withTemplate(templateFile).build()) { |
| | | WriteSheet sheet = EasyExcel.writerSheet("Sheet1").build(); |
| | | |
| | | // 3. **填充季度表头** |
| | | List<String> quarters = PaymentCycleHelper.getQuarterlyPaymentCyclesList(new Date()); |
| | | request.setQuarters(quarters); |
| | | |
| | | Map<String, Object> header = new HashMap<>(); |
| | | for (int i = 0; i < quarters.size(); i++) { |
| | | header.put("key" + (i + 1), quarters.get(i)); // 确保和 `{key1}` ~ `{key20}` 匹配 |
| | | } |
| | | writer.fill(header, sheet); |
| | | |
| | | // 4. **填充数据** |
| | | List<Map<String, Object>> dataList = placementBatchHouseholdService.reportExportsList(request); |
| | | if (dataList == null || dataList.isEmpty()) { |
| | | throw new RuntimeException("导出数据为空"); |
| | | } |
| | | |
| | | FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build(); |
| | | writer.fill(dataList, fillConfig, sheet); |
| | | |
| | | } finally { |
| | | templateFile.close(); |
| | | } |
| | | |
| | | // 5. **设置响应头** |
| | | FileUtils.setExcelResponseHeader(response, "各季度应付款明细列表.xlsx"); |
| | | |
| | | // 6. **输出到浏览器** |
| | | try (BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(response.getOutputStream())) { |
| | | bufferedOutputStream.write(out.toByteArray()); |
| | | bufferedOutputStream.flush(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.ruoyi.bussiness.object.request.report.ReportRequest; |
| | | import com.ruoyi.bussiness.object.response.screen.*; |
| | | import com.ruoyi.bussiness.service.PlacementApplyRecordService; |
| | | import com.ruoyi.bussiness.service.PlacementBatchHouseholdService; |
| | | import com.ruoyi.bussiness.service.PlacementBatchService; |
| | | import com.ruoyi.bussiness.service.ScreenService; |
| | | import com.ruoyi.bussiness.utils.PaymentCycleHelper; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.concurrent.Callable; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.FutureTask; |
| | | |
| | | @Service |
| | | public class ScreenServiceImpl implements ScreenService { |
| | | |
| | | @Autowired |
| | | private PlacementApplyRecordService placementApplyRecordService; |
| | | @Autowired |
| | | private PlacementBatchService placementBatchService; |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @Override |
| | | public ScreenResponse data(ReportRequest request) { |
| | | String month = DateUtil.format(new Date(), "yyyy-MM"); |
| | | //获取当前季度 |
| | | String quarter = PaymentCycleHelper.getQuarterByOffset(new Date(),0); |
| | | //上一个季度 |
| | | String lastQuarter = PaymentCycleHelper.getQuarterByOffset(new Date(),-1); |
| | | String nextQuarter = PaymentCycleHelper.getQuarterByOffset(new Date(),1); |
| | | List<String> quarters = PaymentCycleHelper.getQuarterlyPaymentCyclesFour(new Date()); |
| | | //统计 |
| | | ScreenResponse screenResponse = queryMainData(quarter,lastQuarter,nextQuarter); |
| | | //多线程查询信息 |
| | | ExecutorService executorService = Executors.newFixedThreadPool(8); |
| | | try { |
| | | //已安置情况 |
| | | Callable<SelfBuyResponse> selfBuyResponseCallable = this::selfBuyResponse; |
| | | //镇街道参与户数 |
| | | Callable<List<StreetResponse>> streetResponseCallable = this::streetResponse; |
| | | //导入异常数据 |
| | | Callable<List<ImportErrorResponse>> importErrorResponseCallable = this::getImportErrorResponse; |
| | | //地图 |
| | | Callable<List<MapResponse>> mapResponseCallable = this::getMapResponse; |
| | | //季度款支付进度数据 |
| | | Callable<List<QuarterProcessResponse>> quarterProcessResponseCallable = ()-> getQuarterProcessResponse(request); |
| | | //安置房型占比 |
| | | Callable<List<PlacementTypeResponse>> placementTypeResponseCallable = this::getPlacementTypeResponse; |
| | | //本月应补偿占比 |
| | | Callable<List<MonthCompensationResponse>> monthCompensationResponseCallable = ()-> getMonthCompensationResponses(month); |
| | | //各季度应补偿金额 |
| | | Callable<List<Map<String,Object>> > quarterPayResponseCallable = ()-> getQuarterPayResponse(quarters); |
| | | |
| | | FutureTask<SelfBuyResponse> selfBuyResponseFutureTask = new FutureTask<>(selfBuyResponseCallable); |
| | | FutureTask<List<StreetResponse>> streetResponseFutureTask = new FutureTask<>(streetResponseCallable); |
| | | FutureTask<List<ImportErrorResponse>> importErrorResponseFutureTask = new FutureTask<>(importErrorResponseCallable); |
| | | FutureTask<List<MapResponse>> mapResponseFutureTask = new FutureTask<>(mapResponseCallable); |
| | | FutureTask<List<QuarterProcessResponse>> quarterProcessResponseFutureTask = new FutureTask<>(quarterProcessResponseCallable); |
| | | FutureTask<List<PlacementTypeResponse>> placementTypeResponseFutureTask = new FutureTask<>(placementTypeResponseCallable); |
| | | FutureTask<List<MonthCompensationResponse>> monthCompensationResponseFutureTask = new FutureTask<>(monthCompensationResponseCallable); |
| | | FutureTask<List<Map<String,Object>> > quarterPayResponseFutureTask = new FutureTask<>(quarterPayResponseCallable); |
| | | |
| | | executorService.submit(selfBuyResponseFutureTask); |
| | | executorService.submit(streetResponseFutureTask); |
| | | executorService.submit(importErrorResponseFutureTask); |
| | | executorService.submit(mapResponseFutureTask); |
| | | executorService.submit(quarterProcessResponseFutureTask); |
| | | executorService.submit(placementTypeResponseFutureTask); |
| | | executorService.submit(monthCompensationResponseFutureTask); |
| | | executorService.submit(quarterPayResponseFutureTask); |
| | | |
| | | screenResponse.setSelfBuyResponse(selfBuyResponseFutureTask.get()); |
| | | screenResponse.setStreetResponses(streetResponseFutureTask.get()); |
| | | screenResponse.setImportErrorResponses(importErrorResponseFutureTask.get()); |
| | | screenResponse.setMapResponses(mapResponseFutureTask.get()); |
| | | screenResponse.setQuarterProcessResponses(quarterProcessResponseFutureTask.get()); |
| | | screenResponse.setPlacementTypeResponses(placementTypeResponseFutureTask.get()); |
| | | screenResponse.setMonthCompensationResponses(monthCompensationResponseFutureTask.get()); |
| | | screenResponse.setQuarterPayResponses(quarterPayResponseFutureTask.get()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new GlobalException("获取数据失败"); |
| | | } finally { |
| | | executorService.shutdown(); |
| | | } |
| | | return screenResponse; |
| | | } |
| | | |
| | | /** |
| | | * //修改为统计季度款支付合计了 |
| | | * 首页 申请总户数 本季度支付款金额 下季度支付款金额 统计安置批次房产表 |
| | | * 1.总共申请的户数信息(审核通过的) |
| | | * 2.统计本月需要补偿的金额合计包含(25%首付款。过渡费、季度款)环比是跟上一个月进行比较; |
| | | * 3.统计下个月需要补偿的金额合计包含(25%首付款、过渡费、季度款)环比是跟上一个月进行比较; |
| | | * @return |
| | | */ |
| | | private ScreenResponse queryMainData(String month,String lastMonth,String nextMonth) { |
| | | ScreenResponse screenResponse = placementApplyRecordService.queryMainData(month, lastMonth, nextMonth); |
| | | // 计算环比 |
| | | String monthCompensationAmountRate = calculateRate(screenResponse.getMonthCompensationAmount(), screenResponse.getLastMonthCompensationAmount()); |
| | | String nextMonthCompensationAmountRate = calculateRate(screenResponse.getNextMonthCompensationAmount(), screenResponse.getMonthCompensationAmount()); |
| | | screenResponse.setMonthCompensationAmountRate(monthCompensationAmountRate); |
| | | screenResponse.setNextMonthCompensationAmountRate(nextMonthCompensationAmountRate); |
| | | // 输出结果 |
| | | return screenResponse; |
| | | } |
| | | |
| | | /** |
| | | * 审核通过-已参与自主购房安置统计(统计安置批次房产表) |
| | | * 1. 统计安置批次审核过的总户数和总人数 |
| | | */ |
| | | private SelfBuyResponse selfBuyResponse(){ |
| | | return placementBatchService.getSelfBuyResponse(); |
| | | } |
| | | |
| | | /** |
| | | * 审核通过-各镇/街参与户数排名(统计安置批次房产表) |
| | | * 1.按镇/街维度统计安置批次审核过的总户数 |
| | | * 2.环比根据批次来比较,最新批次比上一批次按审核通过时间) |
| | | * @return |
| | | */ |
| | | private List<StreetResponse> streetResponse() { |
| | | List<StreetResponse> streetResponses = placementBatchService.getStreetResponse(); |
| | | if (ObjUtil.isEmpty(streetResponses)) { |
| | | streetResponses = new ArrayList<>(); |
| | | } |
| | | //获取所有街道(填充无数据街道) |
| | | List<SysDictData> street = dictTypeService.selectDictDataByType("street"); |
| | | |
| | | List<StreetResponse> responses = new ArrayList<>(); |
| | | for(SysDictData sysDictData : street){ |
| | | StreetResponse streetResponse = new StreetResponse(); |
| | | streetResponse.setStreet(sysDictData.getDictLabel()); |
| | | for(StreetResponse itemData : streetResponses){ |
| | | if(itemData.getStreet().equals(streetResponse.getStreet())){ |
| | | streetResponse.setHouseholdNum(itemData.getHouseholdNum()); |
| | | streetResponse.setLatestBatchHouseholdCount(itemData.getLatestBatchHouseholdCount()); |
| | | streetResponse.setSecondLatestBatchHouseholdCount(itemData.getSecondLatestBatchHouseholdCount()); |
| | | } |
| | | } |
| | | responses.add(streetResponse); |
| | | } |
| | | |
| | | for (StreetResponse streetResponse : responses) { |
| | | //计算环比 |
| | | String rate = calculateRate(new BigDecimal(streetResponse.getLatestBatchHouseholdCount()), new BigDecimal(streetResponse.getSecondLatestBatchHouseholdCount())); |
| | | streetResponse.setHouseholdNumRate(rate); |
| | | } |
| | | |
| | | //排序 |
| | | responses.sort(Comparator.comparing(StreetResponse::getHouseholdNum).reversed()); |
| | | return responses; |
| | | } |
| | | |
| | | /** |
| | | * 审核通过-安置批次房产表 |
| | | * 1.补偿金额异常:统计过渡费异常数据、补偿标准金额异常数据; |
| | | * 2.安置面积异常:统计面积异常数据 |
| | | * @return |
| | | */ |
| | | public List<ImportErrorResponse> getImportErrorResponse(){ |
| | | return placementBatchService.getImportErrorResponse(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 地图数据 |
| | | * 按照街道统计户数、安置人数 |
| | | * @return |
| | | */ |
| | | public List<MapResponse> getMapResponse(){ |
| | | List<MapResponse> mapResponses = placementBatchService.getMapResponse(); |
| | | //获取所有街道(填充无数据街道) |
| | | List<SysDictData> street = dictTypeService.selectDictDataByType("street"); |
| | | List<MapResponse> responses = new ArrayList<>(); |
| | | for(SysDictData sysDictData : street){ |
| | | MapResponse mapResponse = new MapResponse(); |
| | | mapResponse.setStreet(sysDictData.getDictLabel()); |
| | | |
| | | for(MapResponse itemData : mapResponses){ |
| | | if(itemData.getStreet().equals(mapResponse.getStreet())){ |
| | | mapResponse.setHouseholdCount(itemData.getHouseholdCount()); |
| | | mapResponse.setPersonCount(itemData.getPersonCount()); |
| | | } |
| | | } |
| | | responses.add(mapResponse); |
| | | } |
| | | |
| | | //渲染不出来崇庆街道的标点 把崇庆街道的数量统计到崇阳街道上 |
| | | Integer householdCount = 0; |
| | | Integer personCount = 0; |
| | | if(ObjUtil.isNotEmpty(responses)) { |
| | | for (MapResponse mapResponse : responses) { |
| | | if (mapResponse.getStreet().equals("崇庆街道")) { |
| | | householdCount = mapResponse.getHouseholdCount(); |
| | | personCount = mapResponse.getPersonCount(); |
| | | } |
| | | } |
| | | boolean exists = true; |
| | | for (MapResponse mapResponse : responses) { |
| | | if (mapResponse.getStreet().equals("崇阳街道")) { |
| | | exists = false; |
| | | mapResponse.setHouseholdCount(mapResponse.getHouseholdCount() + householdCount); |
| | | mapResponse.setPersonCount(mapResponse.getPersonCount() + personCount); |
| | | } |
| | | } |
| | | |
| | | // //不存在崇阳街道 |
| | | // if (exists) { |
| | | // MapResponse mapResponse = new MapResponse(); |
| | | // mapResponse.setHouseholdCount(householdCount); |
| | | // mapResponse.setPersonCount(personCount); |
| | | // mapResponse.setStreet("崇阳街道"); |
| | | // responses.add(mapResponse); |
| | | // } |
| | | |
| | | } |
| | | return responses; |
| | | } |
| | | |
| | | /** |
| | | * 季度款支付进度数据 |
| | | * @return |
| | | */ |
| | | public List<QuarterProcessResponse> getQuarterProcessResponse(ReportRequest request) { |
| | | List<QuarterProcessResponse> responses = placementBatchService.getQuarterProcessResponse(request); |
| | | //计算季度 |
| | | if (ObjUtil.isEmpty(responses)) { |
| | | return responses; |
| | | } |
| | | for (QuarterProcessResponse quarterProcessResponse : responses) { |
| | | Integer period = PaymentCycleHelper.getPaymentPeriod(quarterProcessResponse.getCompensationPayTime()); |
| | | quarterProcessResponse.setProcess(period); |
| | | } |
| | | return responses; |
| | | } |
| | | |
| | | /** |
| | | * 安置房型占比 |
| | | * 根据数量算占比 |
| | | * @return |
| | | */ |
| | | public List<PlacementTypeResponse> getPlacementTypeResponse(){ |
| | | return placementBatchService.getPlacementTypeResponse(); |
| | | } |
| | | |
| | | /** |
| | | * 本月应补偿占比 |
| | | * @return |
| | | */ |
| | | public List<MonthCompensationResponse> getMonthCompensationResponses(String month){ |
| | | return placementBatchService.getMonthCompensationResponses(month); |
| | | } |
| | | |
| | | /** |
| | | * 各季度应补偿金额 |
| | | * @return |
| | | */ |
| | | public List<Map<String,Object>> getQuarterPayResponse(List<String> quarters){ |
| | | return placementBatchService.getQuarterPayResponse(quarters); |
| | | } |
| | | |
| | | /** |
| | | * 计算环比增长率并返回百分比字符串 |
| | | * |
| | | * @param currentMonth 本期金额 |
| | | * @param lastMonth 上期金额 |
| | | * @return 环比增长率(百分比形式,保留2位小数) |
| | | */ |
| | | private static String calculateRate(BigDecimal currentMonth, BigDecimal lastMonth) { |
| | | if (lastMonth == null || lastMonth.compareTo(BigDecimal.ZERO) == 0) { |
| | | return "0%"; // 避免除以零 |
| | | } |
| | | BigDecimal rate = currentMonth.subtract(lastMonth) |
| | | .divide(lastMonth, 4, RoundingMode.HALF_UP) |
| | | .multiply(BigDecimal.valueOf(100)); |
| | | return rate.setScale(2, RoundingMode.HALF_UP) + "%"; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.utils; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | |
| | | import java.io.FileNotFoundException; |
| | | import java.io.FileOutputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | public class BatchNumberUtils { |
| | | |
| | | private static final String PREFIX = "第"; |
| | | private static final String SUFFIX = "批"; |
| | | |
| | | /** |
| | | * 生成批次信息 |
| | | * |
| | | * @param lastBatchNumber |
| | | * @return |
| | | */ |
| | | public static String getBatchNumber(String lastBatchNumber) { |
| | | if (lastBatchNumber == null || !lastBatchNumber.startsWith(PREFIX) || !lastBatchNumber.endsWith(SUFFIX)) { |
| | | return PREFIX + "1" + SUFFIX; |
| | | } |
| | | try { |
| | | // 提取中间的数字 |
| | | String numberPart = lastBatchNumber.substring(PREFIX.length(), lastBatchNumber.length() - SUFFIX.length()); |
| | | int batchNumber = Integer.parseInt(numberPart); |
| | | |
| | | if (batchNumber < 1 || batchNumber >= 9999) { |
| | | throw new GlobalException("批次数必须在 1 到 9999 之间"); |
| | | } |
| | | |
| | | // 计算下一个批次 |
| | | return PREFIX + (batchNumber + 1) + SUFFIX; |
| | | } catch (NumberFormatException e) { |
| | | throw new GlobalException("批次中的数字解析失败,请确保格式正确"); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | // 1. 创建导出参数 |
| | | ExportParams exportParams = new ExportParams("动态表头示例", "Sheet1"); |
| | | |
| | | // 2. 创建表头 |
| | | List<ExcelExportEntity> columnList = new ArrayList<>(); |
| | | |
| | | // 3. 添加静态列 |
| | | columnList.add(new ExcelExportEntity("编号", "id")); |
| | | columnList.add(new ExcelExportEntity("补偿资金总额(万元)", "totalCompensation")); |
| | | columnList.add(new ExcelExportEntity("25%首付款", "firstPayment")); |
| | | columnList.add(new ExcelExportEntity("过渡补贴", "transitionSubsidy")); |
| | | |
| | | // 4. 创建父级列 "每季度需支付款项(万元)",设置 key 为 "dynamic" |
| | | ExcelExportEntity parentColumn = new ExcelExportEntity("每季度需支付款项(万元)", "dynamic"); |
| | | List<ExcelExportEntity> dynamicColumns = new ArrayList<>(); |
| | | |
| | | // 5. 生成动态列(2025-2027,每年4个季度) |
| | | List<String> dynamicHeaders = generateDynamicHeaders(2025, 2027); |
| | | for (String header : dynamicHeaders) { |
| | | ExcelExportEntity column = new ExcelExportEntity(header, header); |
| | | column.setFormat("0.00"); // 确保Excel数值格式正确 |
| | | dynamicColumns.add(column); |
| | | } |
| | | |
| | | // 6. 关联子列 |
| | | parentColumn.setList(dynamicColumns); |
| | | columnList.add(parentColumn); |
| | | |
| | | // 7. 组织数据 |
| | | List<Map<String, Object>> dataList = new ArrayList<>(); |
| | | for (int i = 1; i <= 5; i++) { // 生成5行数据 |
| | | Map<String, Object> row = new HashMap<>(); |
| | | row.put("id", i); |
| | | row.put("totalCompensation", 500 + i * 10); |
| | | row.put("firstPayment", 120 + i * 5); |
| | | row.put("transitionSubsidy", 30 + i * 2); |
| | | |
| | | // 新建子Map存放动态列数据 |
| | | Map<String, Object> dynamicData = new HashMap<>(); |
| | | for (String header : dynamicHeaders) { |
| | | dynamicData.put(header, Math.round(Math.random() * 100 * 100.0) / 100.0); // 存储 Double 类型数据 |
| | | } |
| | | // 将子Map以 key "dynamic" 存入 row 中 |
| | | row.put("dynamic", dynamicData); |
| | | |
| | | System.out.println("生成数据:" + row); // 调试输出 |
| | | dataList.add(row); |
| | | } |
| | | |
| | | // 8. 导出 Excel |
| | | Workbook workbook = ExcelExportUtil.exportExcel(exportParams, columnList, dataList); |
| | | |
| | | // 9. 写入文件 |
| | | try (FileOutputStream fos = new FileOutputStream("DynamicTable.xlsx")) { |
| | | workbook.write(fos); |
| | | } |
| | | workbook.close(); |
| | | |
| | | System.out.println("Excel 导出成功!"); |
| | | } |
| | | |
| | | // 生成动态季度时间列 |
| | | public static List<String> generateDynamicHeaders(int startYear, int endYear) { |
| | | List<String> headers = new ArrayList<>(); |
| | | String[] quarters = {"1月", "4月", "7月", "10月"}; |
| | | for (int year = startYear; year <= endYear; year++) { |
| | | for (String quarter : quarters) { |
| | | headers.add(year + "年" + quarter); |
| | | } |
| | | } |
| | | return headers; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.bussiness.utils; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class PaymentCycleHelper { |
| | | |
| | | // 格式化日期为 "yyyy-MM" |
| | | private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); |
| | | |
| | | // 根据 25% 首付款支付时间计算首笔付款周期 |
| | | public static String getFirstPaymentCycle(Date firstPaymentDate) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(firstPaymentDate); |
| | | |
| | | int month = calendar.get(Calendar.MONTH) + 1; // 获取月份(1-12) |
| | | |
| | | if (month >= 10 && month <= 12) { |
| | | // 10月-12月,首笔付款周期为次年1月 |
| | | calendar.add(Calendar.YEAR, 1); |
| | | calendar.set(Calendar.MONTH, Calendar.JANUARY); // 设置为1月 |
| | | } else if (month >= 1 && month <= 3) { |
| | | // 1月-3月,首笔付款周期为当年4月 |
| | | calendar.set(Calendar.MONTH, Calendar.APRIL); |
| | | } else if (month >= 4 && month <= 6) { |
| | | // 4月-6月,首笔付款周期为当年7月 |
| | | calendar.set(Calendar.MONTH, Calendar.JULY); |
| | | } else if (month >= 7 && month <= 9) { |
| | | // 7月-9月,首笔付款周期为当年10月 |
| | | calendar.set(Calendar.MONTH, Calendar.OCTOBER); |
| | | } |
| | | |
| | | // 返回首笔付款周期格式 "yyyy-MM" |
| | | return sdf.format(calendar.getTime()); |
| | | } |
| | | |
| | | public static String getCurrentQuarter(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH) + 1; // 获取月份(1-12) |
| | | |
| | | // 计算当前季度的起始月份 |
| | | int quarterStartMonth = ((month - 1) / 3) * 3 + 1; |
| | | |
| | | return String.format("%d-%02d", year, quarterStartMonth); |
| | | } |
| | | |
| | | /** |
| | | * 获取季度信息 |
| | | * @param date |
| | | * @param offset |
| | | * @return |
| | | */ |
| | | public static String getQuarterByOffset(Date date, int offset) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH) + 1; // Java中月份是从0开始的 |
| | | |
| | | // 当前季度索引:0(Q1),1(Q2),2(Q3),3(Q4) |
| | | int currentQuarter = (month - 1) / 3; |
| | | |
| | | // 计算目标季度的索引 |
| | | int targetQuarter = currentQuarter + offset; |
| | | |
| | | // 处理跨年情况 |
| | | year += targetQuarter / 4; |
| | | targetQuarter = (targetQuarter % 4 + 4) % 4; // 保证结果在0~3之间 |
| | | |
| | | // 获取目标季度的起始月份 |
| | | int quarterStartMonth = targetQuarter * 3 + 1; |
| | | |
| | | return String.format("%d-%02d", year, quarterStartMonth); |
| | | } |
| | | |
| | | // 根据首笔付款日期往后推 20 期,计算分期支付周期 |
| | | public static String getQuarterlyPaymentCycles(Date firstPaymentDate) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(firstPaymentDate); |
| | | |
| | | // 获取首笔付款周期 |
| | | String firstPaymentCycle = getFirstPaymentCycle(firstPaymentDate); |
| | | try { |
| | | calendar.setTime(sdf.parse(firstPaymentCycle)); // 将首笔付款周期解析为日期 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ""; |
| | | } |
| | | |
| | | // 往后推 20 期,每期为3个月 |
| | | String[] paymentCycles = new String[20]; |
| | | for (int i = 0; i < 20; i++) { |
| | | paymentCycles[i] = sdf.format(calendar.getTime()); |
| | | calendar.add(Calendar.MONTH, 3); // 每次增加 3 个月 |
| | | } |
| | | |
| | | return String.join(",", Arrays.asList(paymentCycles)); |
| | | } |
| | | |
| | | // 根据当前季度首笔付款日期往后推 20 期,计算分期支付周期 |
| | | public static List<String> getQuarterlyPaymentCyclesList(Date firstPaymentDate) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(firstPaymentDate); |
| | | |
| | | // 获取首笔付款周期 |
| | | String firstPaymentCycle = getCurrentQuarter(firstPaymentDate); |
| | | try { |
| | | calendar.setTime(sdf.parse(firstPaymentCycle)); // 将首笔付款周期解析为日期 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | |
| | | // 往后推 20 期,每期为3个月 |
| | | String[] paymentCycles = new String[20]; |
| | | for (int i = 0; i < 20; i++) { |
| | | paymentCycles[i] = sdf.format(calendar.getTime()); |
| | | calendar.add(Calendar.MONTH, 3); // 每次增加 3 个月 |
| | | } |
| | | return Arrays.asList(paymentCycles); |
| | | } |
| | | |
| | | |
| | | // 根据首笔付款日期往后推 4 期,计算分期支付周期 |
| | | public static List<String> getQuarterlyPaymentCyclesFour(Date firstPaymentDate) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(firstPaymentDate); |
| | | |
| | | // 获取首笔付款周期 |
| | | String firstPaymentCycle = getFirstPaymentCycle(firstPaymentDate); |
| | | try { |
| | | calendar.setTime(sdf.parse(firstPaymentCycle)); // 将首笔付款周期解析为日期 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | |
| | | // 往后推 20 期,每期为3个月 |
| | | String[] paymentCycles = new String[4]; |
| | | for (int i = 0; i < 4; i++) { |
| | | paymentCycles[i] = sdf.format(calendar.getTime()); |
| | | calendar.add(Calendar.MONTH, 3); // 每次增加 3 个月 |
| | | } |
| | | return Arrays.asList(paymentCycles); |
| | | } |
| | | |
| | | /** |
| | | * 计算 25% 首付款支付时间属于 20 期中的第几期 |
| | | * |
| | | * @param firstPaymentDate 25% 首付款支付时间(Date 类型) |
| | | * @return 期数(1~20),超出则返回 -1 |
| | | */ |
| | | public static int getPaymentPeriod(Date firstPaymentDate) { |
| | | //判断时间超过5年,则直接返回20 |
| | | long month = DateUtil.betweenMonth(new Date(),firstPaymentDate,true); |
| | | if(month >= 60){ |
| | | return 20; |
| | | } |
| | | List<String> times = getQuarterlyPaymentCyclesList(firstPaymentDate); |
| | | |
| | | //获取当前日期季度 |
| | | String current = getCurrentQuarter(new Date()); |
| | | |
| | | // 计算当前属于哪一期 |
| | | for (int i = 0; i <= times.size(); i++) { |
| | | String itemTime = times.get(i); |
| | | if (itemTime.equals(current)) { |
| | | return i; |
| | | } |
| | | } |
| | | // 如果当前日期超出 20 期,则返回 -1 |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * 将 Date 转换为 LocalDate |
| | | * |
| | | * @param date Date 类型的日期 |
| | | * @return LocalDate 类型的日期 |
| | | */ |
| | | private static LocalDate convertToLocalDate(Date date) { |
| | | return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(getPaymentPeriod(DateUtil.parseDate(" 2023-10-03")));; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.bussiness.mapper.PlacementApplyRecordMapper"> |
| | | |
| | | <select id="queryMainData" resultType="com.ruoyi.bussiness.object.response.screen.ScreenResponse"> |
| | | SELECT |
| | | -- 本季度补偿金额 |
| | | COALESCE(SUM(CASE |
| | | WHEN FIND_IN_SET(#{month},t1.cycle) and t2.`status` = 1 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 END), 0) AS monthCompensationAmount, |
| | | |
| | | -- 本季度补偿金额 |
| | | COALESCE(SUM(CASE |
| | | WHEN FIND_IN_SET(#{lastMonth},cycle) |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 END), 0) AS lastMonthCompensationAmount, |
| | | |
| | | -- 本季度补偿金额 |
| | | COALESCE(SUM(CASE |
| | | WHEN FIND_IN_SET(#{nextMonth},cycle) |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 END), 0) AS nextMonthCompensationAmount, |
| | | |
| | | -- 总户数(根据查询中所有涉及到的 placement_batch_id 汇总) |
| | | -- 总户数(根据查询中所有涉及到的 placement_batch_id 汇总) |
| | | COALESCE( |
| | | ( SELECT count(1) |
| | | |
| | | FROM t_placement_apply_record t1 |
| | | JOIN t_placement_apply t2 ON t1.placement_apply_id = t2.id |
| | | WHERE t2.status = 1 |
| | | |
| | | ), 0) AS houseHoldCount |
| | | |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | </select> |
| | | |
| | | <select id="countPassIdCard" resultType="int" > |
| | | select ifnull(count(1),0) as `count` |
| | | FROM t_placement_apply_record t1 |
| | | left JOIN t_placement_apply t2 ON t1.placement_apply_id = t2.id |
| | | where t2.status = 1 and t1.id_card = #{idCard} |
| | | </select> |
| | | |
| | | <select id="getRecordsByCardIds" resultType="com.ruoyi.bussiness.domain.PlacementApplyRecord"> |
| | | select t1.* |
| | | FROM t_placement_apply_record t1 |
| | | JOIN t_placement_apply t2 ON t1.placement_apply_id = t2.id |
| | | WHERE t2.status = 1 |
| | | and t1.id_card in |
| | | <foreach collection="idCards" item="card" open="(" separator="," close=")"> |
| | | #{card} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="countError" resultType="java.util.Map"> |
| | | SELECT street,(id_card_exists_warn+id_card_no_warn+wait_family_names_warn+wait_family_names_no_warn+ |
| | | wait_family_area_warn+compensation_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as errorNum, |
| | | sum(id_card_exists_warn+id_card_no_warn+wait_family_names_warn+wait_family_names_no_warn) as settleNum, |
| | | sum(wait_family_area_warn) as areaNum, |
| | | sum(compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) compensationNum |
| | | |
| | | FROM t_placement_apply_record where placement_apply_id = #{applyId} |
| | | GROUP BY street |
| | | </select> |
| | | |
| | | <select id="getRecordsByCardId" resultType="com.ruoyi.bussiness.domain.PlacementApplyRecord"> |
| | | select t1.* |
| | | FROM t_placement_apply_record t1 |
| | | JOIN t_placement_apply t2 ON t1.placement_apply_id = t2.id |
| | | WHERE t2.status = 1 |
| | | and t1.id_card = #{idCard} limit 1 |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.bussiness.mapper.PlacementBatchHouseholdMapper"> |
| | | |
| | | <select id="reportPlacementHouseholdSum" |
| | | resultType="com.ruoyi.bussiness.object.response.report.ReportSumResponse"> |
| | | SELECT sum(t1.compensation_sum) as compensation_sum, |
| | | sum(t1.down_payment_amount) as down_payment_amount, |
| | | sum(t1.subsidy_amount) as subsidy_amount, |
| | | sum(t1.quarter_pay_amount)*20 as quarter_pay_amount |
| | | FROM t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | <if test="street != null and street != ''"> |
| | | and t1.street = #{street} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="reportPage" resultType="java.util.Map"> |
| | | SELECT |
| | | t1.street, |
| | | sum(t1.current_count) as currentCount, |
| | | sum(t1.down_payment_amount) as downPaymentAmount, |
| | | sum(t1.subsidy_amount) as subsidyAmount, |
| | | sum(t1.compensation_sum) as compensationSum, |
| | | <foreach collection="request.quarters" item="quarter" separator=","> |
| | | SUM(CASE |
| | | WHEN FIND_IN_SET(#{quarter}, cycle) > 0 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 |
| | | END) AS `${quarter}` |
| | | </foreach> |
| | | FROM |
| | | t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | <if test="request.street != null and request.street != ''"> |
| | | and t1.street = #{request.street} |
| | | </if> |
| | | GROUP BY |
| | | street |
| | | </select> |
| | | |
| | | <select id="reportExportsList" resultType="java.util.Map"> |
| | | SELECT |
| | | t1.street, |
| | | sum(t1.current_count) as currentCount, |
| | | sum(t1.down_payment_amount) as downPaymentAmount, |
| | | sum(t1.subsidy_amount) as subsidyAmount, |
| | | sum(t1.compensation_sum) as compensationSum, |
| | | <foreach collection="request.quarters" item="quarter" index="index" separator=","> |
| | | SUM(CASE |
| | | WHEN FIND_IN_SET(#{quarter}, cycle) > 0 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 |
| | | END) AS value${index + 1} |
| | | </foreach> |
| | | FROM |
| | | t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | <if test="request.street != null and request.street != ''"> |
| | | and t1.street = #{request.street} |
| | | </if> |
| | | GROUP BY |
| | | street |
| | | </select> |
| | | |
| | | <select id="detailPage" resultType="com.ruoyi.bussiness.object.response.report.DetailResponse"> |
| | | select t1.*,t2.batch_number |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | <if test="request.street != null and request.street != ''"> |
| | | and t1.street like concat('%', #{request.street}, '%') |
| | | </if> |
| | | <if test="request.community != null and request.community != ''"> |
| | | and t1.community like concat('%', #{request.community}, '%') |
| | | </if> |
| | | <if test="request.batchNumber != null and request.batchNumber != ''"> |
| | | and t2.batch_number like concat('%', #{request.batchNumber}, '%') |
| | | </if> |
| | | <if test="request.householdHead != null and request.householdHead != ''"> |
| | | and t1.household_head like concat('%', #{request.householdHead}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="sumCurrentMonth" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(t1.subsidy_amount+t1.down_payment_amount),0) |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | AND DATE_FORMAT(t1.compensation_pay_time, '%Y-%m') = #{month}; |
| | | </select> |
| | | |
| | | <select id="countCurrentPerson" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(t1.current_count),0) |
| | | FROM t_placement_batch_household t1 |
| | | LEFT JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | AND t1.sign_time >= DATE_SUB(NOW(), INTERVAL 2 MONTH); |
| | | </select> |
| | | |
| | | <select id="getStreetResponse" resultType="com.ruoyi.bussiness.object.response.screen.StreetResponse"> |
| | | WITH RankedBatches AS ( |
| | | SELECT |
| | | t2.id AS batch_id, |
| | | t1.street, |
| | | SUM(t1.current_count) AS household_count, |
| | | ROW_NUMBER() OVER (PARTITION BY t1.street ORDER BY t2.approve_time DESC) AS batch_rank |
| | | FROM t_placement_batch_household t1 |
| | | LEFT JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | GROUP BY t2.id, t1.street, t2.approve_time |
| | | ), |
| | | StreetTotal AS ( |
| | | SELECT |
| | | t1.street, |
| | | SUM(t1.current_count) AS householdNum |
| | | FROM t_placement_batch_household t1 |
| | | LEFT JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | GROUP BY t1.street |
| | | ) |
| | | SELECT |
| | | st.street, |
| | | st.householdNum, -- ✅ 保持你的字段名不变(总人数) |
| | | |
| | | COALESCE(MAX(CASE WHEN rb.batch_rank = 1 THEN rb.household_count END), 0) AS latest_batch_household_count, |
| | | |
| | | COALESCE(MAX(CASE WHEN rb.batch_rank = 2 THEN rb.household_count END), 0) AS second_latest_batch_household_count |
| | | |
| | | FROM StreetTotal st |
| | | LEFT JOIN RankedBatches rb ON st.street = rb.street |
| | | GROUP BY st.street |
| | | ORDER BY householdNum DESC |
| | | </select> |
| | | |
| | | <select id="getImportErrorResponse" resultType="com.ruoyi.bussiness.object.response.screen.ImportErrorResponse"> |
| | | SELECT DATE_FORMAT(create_time, '%Y-%m') AS month, |
| | | SUM(compensation_num) AS moneyErrorCount, |
| | | SUM(area_num) AS areaErrorCount |
| | | from t_placement_error |
| | | GROUP BY month |
| | | ORDER BY month ASC |
| | | </select> |
| | | |
| | | <select id="getMapResponse" resultType="com.ruoyi.bussiness.object.response.screen.MapResponse"> |
| | | SELECT |
| | | t1.street AS street, -- 街道名称 |
| | | COUNT(DISTINCT t1.id) AS household_count, -- 统计总户数(去重 ID 计数) |
| | | SUM(t1.current_count) AS person_count -- 统计安置总人数 |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 -- 仅统计 status = 1 的数据 |
| | | GROUP BY t1.street |
| | | ORDER BY household_count DESC; -- 按总户数降序排序 |
| | | </select> |
| | | |
| | | <select id="getQuarterProcessResponse" resultType="com.ruoyi.bussiness.object.response.screen.QuarterProcessResponse"> |
| | | SELECT |
| | | t2.batch_number, |
| | | t1.household_head, |
| | | t1.current_count, |
| | | t1.compensation_pay_time |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 |
| | | on t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 -- 仅统计 status = 1 的数据 |
| | | <if test="request.houseHead != null and request.houseHead != ''"> |
| | | and t1.household_head like concat('%', #{request.houseHead}, '%') |
| | | </if> |
| | | and t1.compensation_pay_time is not null |
| | | ORDER BY t2.id DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="getPlacementTypeResponse" resultType="com.ruoyi.bussiness.object.response.screen.PlacementTypeResponse"> |
| | | WITH type_summary AS ( |
| | | -- 计算各类型的面积和数量 |
| | | SELECT |
| | | '新建商品住房' AS type, |
| | | SUM(t1.new_housing_area) AS area, |
| | | SUM(t1.new_housing_num) AS total |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | '商业用房', |
| | | SUM(t1.build_housing_area), |
| | | SUM(t1.build_housing_num) |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | '二手房', |
| | | SUM(t1.old_housing_area), |
| | | SUM(t1.old_housing_num) |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | '停车位', |
| | | 0, |
| | | SUM(t1.new_stop_num) |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | ) |
| | | SELECT |
| | | type, |
| | | area, |
| | | total, |
| | | CONCAT(ROUND(total / NULLIF((SELECT SUM(total) FROM type_summary), 0) * 100, 2), '%') AS rate |
| | | FROM type_summary |
| | | ORDER BY FIELD(type, '新建商品住房', '商业用房', '二手房', '停车位') |
| | | </select> |
| | | |
| | | <select id="getMonthCompensationResponse" resultType="com.ruoyi.bussiness.object.response.screen.MonthCompensationResponse"> |
| | | WITH month_total AS ( |
| | | -- 计算 2025-03 当月的总金额 |
| | | SELECT |
| | | SUM(CASE |
| | | WHEN DATE_FORMAT(t1.compensation_pay_time, '%Y-%m') = #{month} |
| | | THEN t1.subsidy_amount |
| | | ELSE 0 |
| | | END) AS month_compensation, |
| | | SUM(CASE |
| | | WHEN DATE_FORMAT(t1.compensation_pay_time, '%Y-%m') = #{month} |
| | | THEN t1.down_payment_amount |
| | | ELSE 0 |
| | | END) AS month_down_payment, |
| | | IFNULL(SUM(CASE |
| | | WHEN FIND_IN_SET(#{month}, cycle) > 0 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 |
| | | END), 0) AS month_quarter_payment |
| | | FROM t_placement_batch_household t1 |
| | | JOIN t_placement_batch t2 ON t1.placement_batch_id = t2.id |
| | | WHERE t2.status = 1 |
| | | ) |
| | | SELECT '过渡补贴' AS type, |
| | | COALESCE(month_total.month_compensation, 0) AS amount, |
| | | CONCAT(ROUND(month_total.month_compensation / |
| | | NULLIF((month_total.month_compensation + month_total.month_down_payment + month_total.month_quarter_payment), 0) * 100, 2), '%') AS amountRate |
| | | FROM month_total |
| | | UNION ALL |
| | | SELECT '25%首付款', |
| | | COALESCE(month_total.month_down_payment, 0), |
| | | CONCAT(ROUND(month_total.month_down_payment / |
| | | NULLIF((month_total.month_compensation + month_total.month_down_payment + month_total.month_quarter_payment), 0) * 100, 2), '%') |
| | | FROM month_total |
| | | UNION ALL |
| | | SELECT '每季度需支付款项', |
| | | COALESCE(month_total.month_quarter_payment, 0), |
| | | CONCAT(ROUND(month_total.month_quarter_payment / |
| | | NULLIF((month_total.month_compensation + month_total.month_down_payment + month_total.month_quarter_payment), 0) * 100, 2), '%') |
| | | FROM month_total |
| | | </select> |
| | | |
| | | |
| | | <select id="getQuarterPayResponse"> |
| | | SELECT |
| | | <foreach collection="quarters" item="quarter" separator=","> |
| | | SUM(CASE |
| | | WHEN FIND_IN_SET(#{quarter}, cycle) > 0 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 |
| | | END) AS `${quarter}` |
| | | </foreach> |
| | | FROM |
| | | t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | </select> |
| | | |
| | | <select id="getPayMoneyByQuarter" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | ifnull(SUM(CASE |
| | | WHEN FIND_IN_SET(#{quarter}, cycle) > 0 |
| | | THEN t1.quarter_pay_amount |
| | | ELSE 0 |
| | | END),0) AS money |
| | | FROM |
| | | t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | </select> |
| | | |
| | | <select id="getPlacementByIdCards" resultType="com.ruoyi.bussiness.domain.PlacementBatchHousehold"> |
| | | select t1.* |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | and t1.id_card in |
| | | <foreach collection="idCards" item="card" open="(" separator="," close=")"> |
| | | #{card} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getHouseHistory" resultType="com.ruoyi.bussiness.domain.PlacementBatchHousehold"> |
| | | select t1.* |
| | | from t_placement_batch_household t1 |
| | | left join t_placement_batch t2 on t1.placement_batch_id = t2.id |
| | | where t2.status = 1 |
| | | and FIND_IN_SET(#{request.familyName},REPLACE(t1.wait_family_names,"、",",")) |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.bussiness.mapper.PlacementBatchMapper"> |
| | | |
| | | |
| | | <select id="countError" resultType="java.util.Map"> |
| | | SELECT street, errorNum,settleNum,areaNum,compensationNum,houseNum |
| | | FROM ( |
| | | SELECT |
| | | street, |
| | | sum(household_head_warn+id_card_warn+wait_family_area_warn+two_price_warn+ |
| | | price_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as errorNum, |
| | | sum(household_head_warn+id_card_warn) as settleNum, |
| | | sum(wait_family_area_warn) as areaNum, |
| | | sum(two_price_warn+price_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as compensationNum, |
| | | 0 as houseNum |
| | | FROM t_placement_batch_asset |
| | | WHERE placement_batch_id = #{batchId} |
| | | GROUP BY street |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT street, |
| | | sum(household_head_warn + id_card_warn+wait_family_names_warn+wait_family_names_no_warn+wait_family_area_warn+ |
| | | compensation_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn+area_warn) as errorNum, |
| | | sum(household_head_warn+id_card_warn+wait_family_names_warn+wait_family_names_no_warn) as settleNum, |
| | | sum(wait_family_area_warn) as areaNum, |
| | | sum(compensation_amount_warn+compensation_sum_warn+quarter_pay_amount_warn+subsidy_amount_warn) as compensationNum, |
| | | sum(area_warn) as houseNum |
| | | from t_placement_batch_household |
| | | WHERE placement_batch_id = #{batchId} |
| | | GROUP BY street |
| | | |
| | | ) AS combined |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.bussiness.mapper.PlacementErrorMapper"> |
| | | |
| | | <select id="page" resultType="com.ruoyi.bussiness.domain.PlacementError"> |
| | | select street,sum(error_num) as error_num, |
| | | sum(settle_num) as settle_num, |
| | | sum(area_num) as area_num, |
| | | sum(compensation_num) as compensation_num, |
| | | sum(house_num) as house_num |
| | | from t_placement_error |
| | | <if test="request.street != null and request.street != ''"> |
| | | and street = #{request.street} |
| | | </if> |
| | | group by street |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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>chongzhou</artifactId> |
| | | <groupId>com.cz</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>cz-common</artifactId> |
| | | |
| | | <description> |
| | | common通用工具 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- Spring框架基本的核心工具 --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context-support</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringWeb模块 --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-web</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- spring security 安全认证 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pagehelper 分页插件 --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 自定义验证注解 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | |
| | | <!--常用工具类 --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- JSON工具类 --> |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.core</groupId> |
| | | <artifactId>jackson-databind</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 阿里JSON解析器 --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- io常用工具类 --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- excel工具 --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- yml解析器 --> |
| | | <dependency> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Token生成与解析--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Jaxb --> |
| | | <dependency> |
| | | <groupId>javax.xml.bind</groupId> |
| | | <artifactId>jaxb-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- redis 缓存操作 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>io.lettuce</groupId> |
| | | <artifactId>lettuce-core</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pool 对象池 --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-pool2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 解析客户端操作系统、浏览器等 --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- servlet包 --> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 --> |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | <!--mybatis-plus--> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.5.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.25</version> |
| | | </dependency> |
| | | |
| | | <!--easypoi--> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>4.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-base</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-web</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-annotation</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 匿名访问不鉴权注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Anonymous |
| | | { |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 数据权限过滤注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface DataScope |
| | | { |
| | | /** |
| | | * 部门表的别名 |
| | | */ |
| | | public String deptAlias() default ""; |
| | | |
| | | /** |
| | | * 用户表的别名 |
| | | */ |
| | | public String userAlias() default ""; |
| | | |
| | | /** |
| | | * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来 |
| | | */ |
| | | public String permission() default ""; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.enums.DataSourceType; |
| | | |
| | | /** |
| | | * 自定义多数据源切换注解 |
| | | * |
| | | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | @Inherited |
| | | public @interface DataSource |
| | | { |
| | | /** |
| | | * 切换数据源名称 |
| | | */ |
| | | public DataSourceType value() default DataSourceType.MASTER; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import java.math.BigDecimal; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.IndexedColors; |
| | | import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; |
| | | |
| | | /** |
| | | * 自定义导出Excel数据注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | public @interface Excel |
| | | { |
| | | /** |
| | | * 导出时在excel中排序 |
| | | */ |
| | | public int sort() default Integer.MAX_VALUE; |
| | | |
| | | /** |
| | | * 导出到Excel中的名字. |
| | | */ |
| | | public String name() default ""; |
| | | |
| | | /** |
| | | * 日期格式, 如: yyyy-MM-dd |
| | | */ |
| | | public String dateFormat() default ""; |
| | | |
| | | /** |
| | | * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) |
| | | */ |
| | | public String dictType() default ""; |
| | | |
| | | /** |
| | | * 读取内容转表达式 (如: 0=男,1=女,2=未知) |
| | | */ |
| | | public String readConverterExp() default ""; |
| | | |
| | | /** |
| | | * 分隔符,读取字符串组内容 |
| | | */ |
| | | public String separator() default ","; |
| | | |
| | | /** |
| | | * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) |
| | | */ |
| | | public int scale() default -1; |
| | | |
| | | /** |
| | | * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN |
| | | */ |
| | | public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; |
| | | |
| | | /** |
| | | * 导出时在excel中每个列的高度 |
| | | */ |
| | | public double height() default 14; |
| | | |
| | | /** |
| | | * 导出时在excel中每个列的宽度 |
| | | */ |
| | | public double width() default 16; |
| | | |
| | | /** |
| | | * 文字后缀,如% 90 变成90% |
| | | */ |
| | | public String suffix() default ""; |
| | | |
| | | /** |
| | | * 当值为空时,字段的默认值 |
| | | */ |
| | | public String defaultValue() default ""; |
| | | |
| | | /** |
| | | * 提示信息 |
| | | */ |
| | | public String prompt() default ""; |
| | | |
| | | /** |
| | | * 是否允许内容换行 |
| | | */ |
| | | public boolean wrapText() default false; |
| | | |
| | | /** |
| | | * 设置只能选择不能输入的列内容. |
| | | */ |
| | | public String[] combo() default {}; |
| | | |
| | | /** |
| | | * 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解. |
| | | */ |
| | | public boolean comboReadDict() default false; |
| | | |
| | | /** |
| | | * 是否需要纵向合并单元格,应对需求:含有list集合单元格) |
| | | */ |
| | | public boolean needMerge() default false; |
| | | |
| | | /** |
| | | * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. |
| | | */ |
| | | public boolean isExport() default true; |
| | | |
| | | /** |
| | | * 另一个类中的属性名称,支持多级获取,以小数点隔开 |
| | | */ |
| | | public String targetAttr() default ""; |
| | | |
| | | /** |
| | | * 是否自动统计数据,在最后追加一行统计数据总和 |
| | | */ |
| | | public boolean isStatistics() default false; |
| | | |
| | | /** |
| | | * 导出类型(0数字 1字符串 2图片) |
| | | */ |
| | | public ColumnType cellType() default ColumnType.STRING; |
| | | |
| | | /** |
| | | * 导出列头背景颜色 |
| | | */ |
| | | public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT; |
| | | |
| | | /** |
| | | * 导出列头字体颜色 |
| | | */ |
| | | public IndexedColors headerColor() default IndexedColors.WHITE; |
| | | |
| | | /** |
| | | * 导出单元格背景颜色 |
| | | */ |
| | | public IndexedColors backgroundColor() default IndexedColors.WHITE; |
| | | |
| | | /** |
| | | * 导出单元格字体颜色 |
| | | */ |
| | | public IndexedColors color() default IndexedColors.BLACK; |
| | | |
| | | /** |
| | | * 导出字段对齐方式 |
| | | */ |
| | | public HorizontalAlignment align() default HorizontalAlignment.CENTER; |
| | | |
| | | /** |
| | | * 自定义数据处理器 |
| | | */ |
| | | public Class<?> handler() default ExcelHandlerAdapter.class; |
| | | |
| | | /** |
| | | * 自定义数据处理器参数 |
| | | */ |
| | | public String[] args() default {}; |
| | | |
| | | /** |
| | | * 字段类型(0:导出导入;1:仅导出;2:仅导入) |
| | | */ |
| | | Type type() default Type.ALL; |
| | | |
| | | public enum Type |
| | | { |
| | | ALL(0), EXPORT(1), IMPORT(2); |
| | | private final int value; |
| | | |
| | | Type(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | |
| | | public enum ColumnType |
| | | { |
| | | NUMERIC(0), STRING(1), IMAGE(2), TEXT(3); |
| | | private final int value; |
| | | |
| | | ColumnType(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * Excel注解集 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Excels |
| | | { |
| | | public Excel[] value(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.OperatorType; |
| | | |
| | | /** |
| | | * 自定义操作日志记录注解 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Target({ ElementType.PARAMETER, ElementType.METHOD }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Log |
| | | { |
| | | /** |
| | | * 模块 |
| | | */ |
| | | public String title() default ""; |
| | | |
| | | /** |
| | | * 功能 |
| | | */ |
| | | public BusinessType businessType() default BusinessType.OTHER; |
| | | |
| | | /** |
| | | * 操作人类别 |
| | | */ |
| | | public OperatorType operatorType() default OperatorType.MANAGE; |
| | | |
| | | /** |
| | | * 是否保存请求的参数 |
| | | */ |
| | | public boolean isSaveRequestData() default true; |
| | | |
| | | /** |
| | | * 是否保存响应的参数 |
| | | */ |
| | | public boolean isSaveResponseData() default true; |
| | | |
| | | /** |
| | | * 排除指定的请求参数 |
| | | */ |
| | | public String[] excludeParamNames() default {}; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.enums.LimitType; |
| | | |
| | | /** |
| | | * 限流注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RateLimiter |
| | | { |
| | | /** |
| | | * 限流key |
| | | */ |
| | | public String key() default CacheConstants.RATE_LIMIT_KEY; |
| | | |
| | | /** |
| | | * 限流时间,单位秒 |
| | | */ |
| | | public int time() default 60; |
| | | |
| | | /** |
| | | * 限流次数 |
| | | */ |
| | | public int count() default 100; |
| | | |
| | | /** |
| | | * 限流类型 |
| | | */ |
| | | public LimitType limitType() default LimitType.DEFAULT; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 自定义注解防止表单重复提交 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Inherited |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RepeatSubmit |
| | | { |
| | | /** |
| | | * 间隔时间(ms),小于此时间视为重复提交 |
| | | */ |
| | | public int interval() default 5000; |
| | | |
| | | /** |
| | | * 提示消息 |
| | | */ |
| | | public String message() default "不允许重复提交,请稍候再试"; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.ruoyi.common.config.serializer.SensitiveJsonSerializer; |
| | | import com.ruoyi.common.enums.DesensitizedType; |
| | | |
| | | /** |
| | | * 数据脱敏注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | @JacksonAnnotationsInside |
| | | @JsonSerialize(using = SensitiveJsonSerializer.class) |
| | | public @interface Sensitive |
| | | { |
| | | DesensitizedType desensitizedType(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 读取项目相关配置 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "ruoyi") |
| | | public class RuoYiConfig |
| | | { |
| | | /** 项目名称 */ |
| | | private String name; |
| | | |
| | | /** 版本 */ |
| | | private String version; |
| | | |
| | | /** 版权年份 */ |
| | | private String copyrightYear; |
| | | |
| | | /** 上传路径 */ |
| | | private static String profile; |
| | | |
| | | /** 获取地址开关 */ |
| | | private static boolean addressEnabled; |
| | | |
| | | /** 验证码类型 */ |
| | | private static String captchaType; |
| | | |
| | | public String getName() |
| | | { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) |
| | | { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getVersion() |
| | | { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) |
| | | { |
| | | this.version = version; |
| | | } |
| | | |
| | | public String getCopyrightYear() |
| | | { |
| | | return copyrightYear; |
| | | } |
| | | |
| | | public void setCopyrightYear(String copyrightYear) |
| | | { |
| | | this.copyrightYear = copyrightYear; |
| | | } |
| | | |
| | | public static String getProfile() |
| | | { |
| | | return profile; |
| | | } |
| | | |
| | | public void setProfile(String profile) |
| | | { |
| | | RuoYiConfig.profile = profile; |
| | | } |
| | | |
| | | public static boolean isAddressEnabled() |
| | | { |
| | | return addressEnabled; |
| | | } |
| | | |
| | | public void setAddressEnabled(boolean addressEnabled) |
| | | { |
| | | RuoYiConfig.addressEnabled = addressEnabled; |
| | | } |
| | | |
| | | public static String getCaptchaType() { |
| | | return captchaType; |
| | | } |
| | | |
| | | public void setCaptchaType(String captchaType) { |
| | | RuoYiConfig.captchaType = captchaType; |
| | | } |
| | | |
| | | /** |
| | | * 获取导入上传路径 |
| | | */ |
| | | public static String getImportPath() |
| | | { |
| | | return getProfile() + "/import"; |
| | | } |
| | | |
| | | /** |
| | | * 获取头像上传路径 |
| | | */ |
| | | public static String getAvatarPath() |
| | | { |
| | | return getProfile() + "/avatar"; |
| | | } |
| | | |
| | | /** |
| | | * 获取下载路径 |
| | | */ |
| | | public static String getDownloadPath() |
| | | { |
| | | return getProfile() + "/download/"; |
| | | } |
| | | |
| | | /** |
| | | * 获取上传路径 |
| | | */ |
| | | public static String getUploadPath() |
| | | { |
| | | return getProfile() + "/upload"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.config.serializer; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Objects; |
| | | import com.fasterxml.jackson.core.JsonGenerator; |
| | | import com.fasterxml.jackson.databind.BeanProperty; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.JsonSerializer; |
| | | import com.fasterxml.jackson.databind.SerializerProvider; |
| | | import com.fasterxml.jackson.databind.ser.ContextualSerializer; |
| | | import com.ruoyi.common.annotation.Sensitive; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.DesensitizedType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | /** |
| | | * 数据脱敏序列化过滤 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer |
| | | { |
| | | private DesensitizedType desensitizedType; |
| | | |
| | | @Override |
| | | public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException |
| | | { |
| | | if (desensitization()) |
| | | { |
| | | gen.writeString(desensitizedType.desensitizer().apply(value)); |
| | | } |
| | | else |
| | | { |
| | | gen.writeString(value); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) |
| | | throws JsonMappingException |
| | | { |
| | | Sensitive annotation = property.getAnnotation(Sensitive.class); |
| | | if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) |
| | | { |
| | | this.desensitizedType = annotation.desensitizedType(); |
| | | return this; |
| | | } |
| | | return prov.findValueSerializer(property.getType(), property); |
| | | } |
| | | |
| | | /** |
| | | * 是否需要脱敏处理 |
| | | */ |
| | | private boolean desensitization() |
| | | { |
| | | try |
| | | { |
| | | LoginUser securityUser = SecurityUtils.getLoginUser(); |
| | | // 管理员不脱敏 |
| | | return !securityUser.getUser().isAdmin(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 缓存的key 常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CacheConstants |
| | | { |
| | | /** |
| | | * 登录用户 redis key |
| | | */ |
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:"; |
| | | |
| | | /** |
| | | * 验证码 redis key |
| | | */ |
| | | public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; |
| | | |
| | | /** |
| | | * 参数管理 cache key |
| | | */ |
| | | public static final String SYS_CONFIG_KEY = "sys_config:"; |
| | | |
| | | /** |
| | | * 字典管理 cache key |
| | | */ |
| | | public static final String SYS_DICT_KEY = "sys_dict:"; |
| | | |
| | | /** |
| | | * 防重提交 redis key |
| | | */ |
| | | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
| | | |
| | | /** |
| | | * 限流 redis key |
| | | */ |
| | | public static final String RATE_LIMIT_KEY = "rate_limit:"; |
| | | |
| | | /** |
| | | * 登录账户密码错误次数 redis key |
| | | */ |
| | | public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | import java.util.Locale; |
| | | import io.jsonwebtoken.Claims; |
| | | |
| | | /** |
| | | * 通用常量信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Constants |
| | | { |
| | | /** |
| | | * UTF-8 字符集 |
| | | */ |
| | | public static final String UTF8 = "UTF-8"; |
| | | |
| | | /** |
| | | * GBK 字符集 |
| | | */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** |
| | | * 系统语言 |
| | | */ |
| | | public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE; |
| | | |
| | | /** |
| | | * www主域 |
| | | */ |
| | | public static final String WWW = "www."; |
| | | |
| | | /** |
| | | * http请求 |
| | | */ |
| | | public static final String HTTP = "http://"; |
| | | |
| | | /** |
| | | * https请求 |
| | | */ |
| | | public static final String HTTPS = "https://"; |
| | | |
| | | /** |
| | | * 通用成功标识 |
| | | */ |
| | | public static final String SUCCESS = "0"; |
| | | |
| | | /** |
| | | * 通用失败标识 |
| | | */ |
| | | public static final String FAIL = "1"; |
| | | |
| | | /** |
| | | * 登录成功 |
| | | */ |
| | | public static final String LOGIN_SUCCESS = "Success"; |
| | | |
| | | /** |
| | | * 注销 |
| | | */ |
| | | public static final String LOGOUT = "Logout"; |
| | | |
| | | /** |
| | | * 注册 |
| | | */ |
| | | public static final String REGISTER = "Register"; |
| | | |
| | | /** |
| | | * 登录失败 |
| | | */ |
| | | public static final String LOGIN_FAIL = "Error"; |
| | | |
| | | /** |
| | | * 所有权限标识 |
| | | */ |
| | | public static final String ALL_PERMISSION = "*:*:*"; |
| | | |
| | | /** |
| | | * 管理员角色权限标识 |
| | | */ |
| | | public static final String SUPER_ADMIN = "admin"; |
| | | |
| | | /** |
| | | * 角色权限分隔符 |
| | | */ |
| | | public static final String ROLE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 权限标识分隔符 |
| | | */ |
| | | public static final String PERMISSION_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 验证码有效期(分钟) |
| | | */ |
| | | public static final Integer CAPTCHA_EXPIRATION = 2; |
| | | |
| | | /** |
| | | * 令牌 |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String TOKEN_PREFIX = "Bearer "; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | public static final String JWT_USERID = "userid"; |
| | | |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | public static final String JWT_USERNAME = Claims.SUBJECT; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | public static final String JWT_AVATAR = "avatar"; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | public static final String JWT_CREATED = "created"; |
| | | |
| | | /** |
| | | * 用户权限 |
| | | */ |
| | | public static final String JWT_AUTHORITIES = "authorities"; |
| | | |
| | | /** |
| | | * 资源映射路径 前缀 |
| | | */ |
| | | public static final String RESOURCE_PREFIX = "/profile"; |
| | | |
| | | /** |
| | | * RMI 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_RMI = "rmi:"; |
| | | |
| | | /** |
| | | * LDAP 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAP = "ldap:"; |
| | | |
| | | /** |
| | | * LDAPS 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAPS = "ldaps:"; |
| | | |
| | | /** |
| | | * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全) |
| | | */ |
| | | public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" }; |
| | | |
| | | /** |
| | | * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
| | | */ |
| | | public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" }; |
| | | |
| | | /** |
| | | * 定时任务违规的字符 |
| | | */ |
| | | public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", |
| | | "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" }; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 代码生成通用常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GenConstants |
| | | { |
| | | /** 单表(增删改查) */ |
| | | public static final String TPL_CRUD = "crud"; |
| | | |
| | | /** 树表(增删改查) */ |
| | | public static final String TPL_TREE = "tree"; |
| | | |
| | | /** 主子表(增删改查) */ |
| | | public static final String TPL_SUB = "sub"; |
| | | |
| | | /** 树编码字段 */ |
| | | public static final String TREE_CODE = "treeCode"; |
| | | |
| | | /** 树父编码字段 */ |
| | | public static final String TREE_PARENT_CODE = "treeParentCode"; |
| | | |
| | | /** 树名称字段 */ |
| | | public static final String TREE_NAME = "treeName"; |
| | | |
| | | /** 上级菜单ID字段 */ |
| | | public static final String PARENT_MENU_ID = "parentMenuId"; |
| | | |
| | | /** 上级菜单名称字段 */ |
| | | public static final String PARENT_MENU_NAME = "parentMenuName"; |
| | | |
| | | /** 数据库字符串类型 */ |
| | | public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; |
| | | |
| | | /** 数据库文本类型 */ |
| | | public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; |
| | | |
| | | /** 数据库时间类型 */ |
| | | public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; |
| | | |
| | | /** 数据库数字类型 */ |
| | | public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", |
| | | "bit", "bigint", "float", "double", "decimal" }; |
| | | |
| | | /** 页面不需要编辑字段 */ |
| | | public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; |
| | | |
| | | /** 页面不需要显示的列表字段 */ |
| | | public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time" }; |
| | | |
| | | /** 页面不需要查询字段 */ |
| | | public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time", "remark" }; |
| | | |
| | | /** Entity基类字段 */ |
| | | public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; |
| | | |
| | | /** Tree基类字段 */ |
| | | public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; |
| | | |
| | | /** 文本框 */ |
| | | public static final String HTML_INPUT = "input"; |
| | | |
| | | /** 文本域 */ |
| | | public static final String HTML_TEXTAREA = "textarea"; |
| | | |
| | | /** 下拉框 */ |
| | | public static final String HTML_SELECT = "select"; |
| | | |
| | | /** 单选框 */ |
| | | public static final String HTML_RADIO = "radio"; |
| | | |
| | | /** 复选框 */ |
| | | public static final String HTML_CHECKBOX = "checkbox"; |
| | | |
| | | /** 日期控件 */ |
| | | public static final String HTML_DATETIME = "datetime"; |
| | | |
| | | /** 图片上传控件 */ |
| | | public static final String HTML_IMAGE_UPLOAD = "imageUpload"; |
| | | |
| | | /** 文件上传控件 */ |
| | | public static final String HTML_FILE_UPLOAD = "fileUpload"; |
| | | |
| | | /** 富文本控件 */ |
| | | public static final String HTML_EDITOR = "editor"; |
| | | |
| | | /** 字符串类型 */ |
| | | public static final String TYPE_STRING = "String"; |
| | | |
| | | /** 整型 */ |
| | | public static final String TYPE_INTEGER = "Integer"; |
| | | |
| | | /** 长整型 */ |
| | | public static final String TYPE_LONG = "Long"; |
| | | |
| | | /** 浮点型 */ |
| | | public static final String TYPE_DOUBLE = "Double"; |
| | | |
| | | /** 高精度计算类型 */ |
| | | public static final String TYPE_BIGDECIMAL = "BigDecimal"; |
| | | |
| | | /** 时间类型 */ |
| | | public static final String TYPE_DATE = "Date"; |
| | | |
| | | /** 模糊查询 */ |
| | | public static final String QUERY_LIKE = "LIKE"; |
| | | |
| | | /** 相等查询 */ |
| | | public static final String QUERY_EQ = "EQ"; |
| | | |
| | | /** 需要 */ |
| | | public static final String REQUIRE = "1"; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 返回状态码 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class HttpStatus |
| | | { |
| | | /** |
| | | * 操作成功 |
| | | */ |
| | | public static final int SUCCESS = 200; |
| | | |
| | | /** |
| | | * 对象创建成功 |
| | | */ |
| | | public static final int CREATED = 201; |
| | | |
| | | /** |
| | | * 请求已经被接受 |
| | | */ |
| | | public static final int ACCEPTED = 202; |
| | | |
| | | /** |
| | | * 操作已经执行成功,但是没有返回数据 |
| | | */ |
| | | public static final int NO_CONTENT = 204; |
| | | |
| | | /** |
| | | * 资源已被移除 |
| | | */ |
| | | public static final int MOVED_PERM = 301; |
| | | |
| | | /** |
| | | * 重定向 |
| | | */ |
| | | public static final int SEE_OTHER = 303; |
| | | |
| | | /** |
| | | * 资源没有被修改 |
| | | */ |
| | | public static final int NOT_MODIFIED = 304; |
| | | |
| | | /** |
| | | * 参数列表错误(缺少,格式不匹配) |
| | | */ |
| | | public static final int BAD_REQUEST = 400; |
| | | |
| | | /** |
| | | * 未授权 |
| | | */ |
| | | public static final int UNAUTHORIZED = 401; |
| | | |
| | | /** |
| | | * 访问受限,授权过期 |
| | | */ |
| | | public static final int FORBIDDEN = 403; |
| | | |
| | | /** |
| | | * 资源,服务未找到 |
| | | */ |
| | | public static final int NOT_FOUND = 404; |
| | | |
| | | /** |
| | | * 不允许的http方法 |
| | | */ |
| | | public static final int BAD_METHOD = 405; |
| | | |
| | | /** |
| | | * 资源冲突,或者资源被锁 |
| | | */ |
| | | public static final int CONFLICT = 409; |
| | | |
| | | /** |
| | | * 不支持的数据,媒体类型 |
| | | */ |
| | | public static final int UNSUPPORTED_TYPE = 415; |
| | | |
| | | /** |
| | | * 系统内部错误 |
| | | */ |
| | | public static final int ERROR = 500; |
| | | |
| | | /** |
| | | * 接口未实现 |
| | | */ |
| | | public static final int NOT_IMPLEMENTED = 501; |
| | | |
| | | /** |
| | | * 系统警告消息 |
| | | */ |
| | | public static final int WARN = 601; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 任务调度通用常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ScheduleConstants |
| | | { |
| | | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; |
| | | |
| | | /** 执行目标key */ |
| | | public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; |
| | | |
| | | /** 默认 */ |
| | | public static final String MISFIRE_DEFAULT = "0"; |
| | | |
| | | /** 立即触发执行 */ |
| | | public static final String MISFIRE_IGNORE_MISFIRES = "1"; |
| | | |
| | | /** 触发一次执行 */ |
| | | public static final String MISFIRE_FIRE_AND_PROCEED = "2"; |
| | | |
| | | /** 不触发立即执行 */ |
| | | public static final String MISFIRE_DO_NOTHING = "3"; |
| | | |
| | | public enum Status |
| | | { |
| | | /** |
| | | * 正常 |
| | | */ |
| | | NORMAL("0"), |
| | | /** |
| | | * 暂停 |
| | | */ |
| | | PAUSE("1"); |
| | | |
| | | private String value; |
| | | |
| | | private Status(String value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getValue() |
| | | { |
| | | return value; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 用户常量信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserConstants |
| | | { |
| | | /** |
| | | * 平台内系统用户的唯一标志 |
| | | */ |
| | | public static final String SYS_USER = "SYS_USER"; |
| | | |
| | | /** 正常状态 */ |
| | | public static final String NORMAL = "0"; |
| | | |
| | | /** 异常状态 */ |
| | | public static final String EXCEPTION = "1"; |
| | | |
| | | /** 用户封禁状态 */ |
| | | public static final String USER_DISABLE = "1"; |
| | | |
| | | /** 角色正常状态 */ |
| | | public static final String ROLE_NORMAL = "0"; |
| | | |
| | | /** 角色封禁状态 */ |
| | | public static final String ROLE_DISABLE = "1"; |
| | | |
| | | /** 部门正常状态 */ |
| | | public static final String DEPT_NORMAL = "0"; |
| | | |
| | | /** 部门停用状态 */ |
| | | public static final String DEPT_DISABLE = "1"; |
| | | |
| | | /** 字典正常状态 */ |
| | | public static final String DICT_NORMAL = "0"; |
| | | |
| | | /** 是否为系统默认(是) */ |
| | | public static final String YES = "Y"; |
| | | |
| | | /** 是否菜单外链(是) */ |
| | | public static final String YES_FRAME = "0"; |
| | | |
| | | /** 是否菜单外链(否) */ |
| | | public static final String NO_FRAME = "1"; |
| | | |
| | | /** 菜单类型(目录) */ |
| | | public static final String TYPE_DIR = "M"; |
| | | |
| | | /** 菜单类型(菜单) */ |
| | | public static final String TYPE_MENU = "C"; |
| | | |
| | | /** 菜单类型(按钮) */ |
| | | public static final String TYPE_BUTTON = "F"; |
| | | |
| | | /** Layout组件标识 */ |
| | | public final static String LAYOUT = "Layout"; |
| | | |
| | | /** ParentView组件标识 */ |
| | | public final static String PARENT_VIEW = "ParentView"; |
| | | |
| | | /** InnerLink组件标识 */ |
| | | public final static String INNER_LINK = "InnerLink"; |
| | | |
| | | /** 校验是否唯一的返回标识 */ |
| | | public final static boolean UNIQUE = true; |
| | | public final static boolean NOT_UNIQUE = false; |
| | | |
| | | /** |
| | | * 用户名长度限制 |
| | | */ |
| | | public static final int USERNAME_MIN_LENGTH = 2; |
| | | public static final int USERNAME_MAX_LENGTH = 20; |
| | | |
| | | /** |
| | | * 密码长度限制 |
| | | */ |
| | | public static final int PASSWORD_MIN_LENGTH = 5; |
| | | public static final int PASSWORD_MAX_LENGTH = 20; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.controller; |
| | | |
| | | import java.beans.PropertyEditorSupport; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.WebDataBinder; |
| | | import org.springframework.web.bind.annotation.InitBinder; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.page.TableSupport; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.sql.SqlUtil; |
| | | |
| | | /** |
| | | * web层通用数据处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseController |
| | | { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | /** |
| | | * 将前台传递过来的日期格式的字符串,自动转化为Date类型 |
| | | */ |
| | | @InitBinder |
| | | public void initBinder(WebDataBinder binder) |
| | | { |
| | | // Date 类型转换 |
| | | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() |
| | | { |
| | | @Override |
| | | public void setAsText(String text) |
| | | { |
| | | setValue(DateUtils.parseDate(text)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 设置请求分页数据 |
| | | */ |
| | | protected void startPage() |
| | | { |
| | | PageUtils.startPage(); |
| | | } |
| | | |
| | | /** |
| | | * 设置请求排序数据 |
| | | */ |
| | | protected void startOrderBy() |
| | | { |
| | | PageDomain pageDomain = TableSupport.buildPageRequest(); |
| | | if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) |
| | | { |
| | | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); |
| | | PageHelper.orderBy(orderBy); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 清理分页的线程变量 |
| | | */ |
| | | protected void clearPage() |
| | | { |
| | | PageUtils.clearPage(); |
| | | } |
| | | |
| | | /** |
| | | * 响应请求分页数据 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(list); |
| | | rspData.setTotal(new PageInfo(list).getTotal()); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 返回成功 |
| | | */ |
| | | public AjaxResult success() |
| | | { |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public AjaxResult error() |
| | | { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | */ |
| | | public AjaxResult success(String message) |
| | | { |
| | | return AjaxResult.success(message); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | */ |
| | | public AjaxResult success(Object data) |
| | | { |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public AjaxResult error(String message) |
| | | { |
| | | return AjaxResult.error(message); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | */ |
| | | public AjaxResult warn(String message) |
| | | { |
| | | return AjaxResult.warn(message); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param rows 影响行数 |
| | | * @return 操作结果 |
| | | */ |
| | | protected AjaxResult toAjax(int rows) |
| | | { |
| | | return rows > 0 ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param result 结果 |
| | | * @return 操作结果 |
| | | */ |
| | | protected AjaxResult toAjax(boolean result) |
| | | { |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | /** |
| | | * 页面跳转 |
| | | */ |
| | | public String redirect(String url) |
| | | { |
| | | return StringUtils.format("redirect:{}", url); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户缓存信息 |
| | | */ |
| | | public LoginUser getLoginUser() |
| | | { |
| | | return SecurityUtils.getLoginUser(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户id |
| | | */ |
| | | public Long getUserId() |
| | | { |
| | | return getLoginUser().getUserId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录部门id |
| | | */ |
| | | public Long getDeptId() |
| | | { |
| | | return getLoginUser().getDeptId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户名 |
| | | */ |
| | | public String getUsername() |
| | | { |
| | | return getLoginUser().getUsername(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Objects; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 操作消息提醒 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class AjaxResult extends HashMap<String, Object> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 状态码 |
| | | */ |
| | | public static final String CODE_TAG = "code"; |
| | | |
| | | /** |
| | | * 返回内容 |
| | | */ |
| | | public static final String MSG_TAG = "msg"; |
| | | |
| | | /** |
| | | * 数据对象 |
| | | */ |
| | | public static final String DATA_TAG = "data"; |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 |
| | | */ |
| | | public AjaxResult() { |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | */ |
| | | public AjaxResult(int code, String msg) { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | */ |
| | | public AjaxResult(int code, String msg, Object data) { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | if (StringUtils.isNotNull(data)) { |
| | | super.put(DATA_TAG, data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success() { |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功数据 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(Object data) { |
| | | return AjaxResult.success("操作成功", data); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg) { |
| | | return AjaxResult.success(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg, Object data) { |
| | | return new AjaxResult(HttpStatus.SUCCESS, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult warn(String msg) { |
| | | return AjaxResult.warn(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult warn(String msg, Object data) { |
| | | return new AjaxResult(HttpStatus.WARN, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error() { |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(String msg) { |
| | | return AjaxResult.error(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(String msg, Object data) { |
| | | return new AjaxResult(HttpStatus.ERROR, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(int code, String msg) { |
| | | return new AjaxResult(code, msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 是否为成功消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isSuccess() { |
| | | return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 是否为警告消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isWarn() { |
| | | return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 是否为错误消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isError() { |
| | | return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 方便链式调用 |
| | | * |
| | | * @param key 键 |
| | | * @param value 值 |
| | | * @return 数据对象 |
| | | */ |
| | | @Override |
| | | public AjaxResult put(String key, Object value) { |
| | | super.put(key, value); |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * Entity基类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseEntity implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 搜索值 */ |
| | | @JsonIgnore |
| | | @TableField(exist = false) |
| | | private String searchValue; |
| | | |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | /** 创建时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | /** 请求参数 */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params; |
| | | |
| | | public String getSearchValue() |
| | | { |
| | | return searchValue; |
| | | } |
| | | |
| | | public void setSearchValue(String searchValue) |
| | | { |
| | | this.searchValue = searchValue; |
| | | } |
| | | |
| | | public String getCreateBy() |
| | | { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) |
| | | { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() |
| | | { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) |
| | | { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() |
| | | { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) |
| | | { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() |
| | | { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) |
| | | { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getRemark() |
| | | { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) |
| | | { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Map<String, Object> getParams() |
| | | { |
| | | if (params == null) |
| | | { |
| | | params = new HashMap<>(); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | public void setParams(Map<String, Object> params) |
| | | { |
| | | this.params = params; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONWriter; |
| | | |
| | | /** |
| | | * 业务使用 |
| | | * @param <T> |
| | | */ |
| | | public class BaseResult<T> { |
| | | |
| | | private Integer code; |
| | | |
| | | private String msg; |
| | | |
| | | private T data; |
| | | |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return JSON.toJSONString(this, JSONWriter.Feature.IgnoreNonFieldGetter); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | |
| | | /** |
| | | * 响应信息主体 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class R<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 成功 */ |
| | | public static final int SUCCESS = HttpStatus.SUCCESS; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = HttpStatus.ERROR; |
| | | |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private T data; |
| | | |
| | | public static <T> R<T> ok() |
| | | { |
| | | return restResult(null, SUCCESS, "操作成功"); |
| | | } |
| | | |
| | | public static <T> R<T> ok(T data) |
| | | { |
| | | return restResult(data, SUCCESS, "操作成功"); |
| | | } |
| | | |
| | | public static <T> R<T> ok(T data, String msg) |
| | | { |
| | | return restResult(data, SUCCESS, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail() |
| | | { |
| | | return restResult(null, FAIL, "操作失败"); |
| | | } |
| | | |
| | | public static <T> R<T> fail(String msg) |
| | | { |
| | | return restResult(null, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data) |
| | | { |
| | | return restResult(data, FAIL, "操作失败"); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data, String msg) |
| | | { |
| | | return restResult(data, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(int code, String msg) |
| | | { |
| | | return restResult(null, code, msg); |
| | | } |
| | | |
| | | private static <T> R<T> restResult(T data, int code, String msg) |
| | | { |
| | | R<T> apiResult = new R<>(); |
| | | apiResult.setCode(code); |
| | | apiResult.setData(data); |
| | | apiResult.setMsg(msg); |
| | | return apiResult; |
| | | } |
| | | |
| | | public int getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() |
| | | { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) |
| | | { |
| | | this.data = data; |
| | | } |
| | | |
| | | public static <T> Boolean isError(R<T> ret) |
| | | { |
| | | return !isSuccess(ret); |
| | | } |
| | | |
| | | public static <T> Boolean isSuccess(R<T> ret) |
| | | { |
| | | return R.SUCCESS == ret.getCode(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | |
| | | /** |
| | | * 返回工具 |
| | | */ |
| | | public class ResponseUtils { |
| | | |
| | | |
| | | public static <T> BaseResult<T> successResponse(T obj) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(obj); |
| | | response.setCode(200); |
| | | response.setMsg("成功"); |
| | | return response; |
| | | } |
| | | |
| | | public static <T> BaseResult<T> successResponse(String msg) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(null); |
| | | response.setCode(200); |
| | | response.setMsg(msg); |
| | | return response; |
| | | } |
| | | |
| | | public static <T> BaseResult<T> successResponse(T obj, String msg) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(obj); |
| | | response.setCode(200); |
| | | response.setMsg(msg); |
| | | return response; |
| | | } |
| | | |
| | | public static BaseResult<Object> successResponse() { |
| | | BaseResult<Object> response = new BaseResult<>(); |
| | | response.setCode(200); |
| | | response.setMsg("成功"); |
| | | response.setData(new JSONObject()); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | public static <T> BaseResult<T> errorResponse(T obj, String msg) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(obj); |
| | | response.setCode(500); |
| | | response.setMsg(msg); |
| | | return response; |
| | | } |
| | | |
| | | public static <T> BaseResult<T> errorResponse(Integer code,String msg) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(null); |
| | | response.setCode(code); |
| | | response.setMsg(msg); |
| | | return response; |
| | | } |
| | | |
| | | public static <T> BaseResult<T> errorResponse(String msg) { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(null); |
| | | response.setCode(500); |
| | | response.setMsg(msg); |
| | | return response; |
| | | } |
| | | |
| | | public static <T> BaseResult<T> errorResponse() { |
| | | BaseResult<T> response = new BaseResult<>(); |
| | | response.setData(null); |
| | | response.setCode(500); |
| | | response.setMsg("失败"); |
| | | return response; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Tree基类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeEntity extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 父菜单名称 */ |
| | | private String parentName; |
| | | |
| | | /** 父菜单ID */ |
| | | private Long parentId; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 祖级列表 */ |
| | | private String ancestors; |
| | | |
| | | /** 子部门 */ |
| | | private List<?> children = new ArrayList<>(); |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | public List<?> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<?> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * Treeselect树结构实体类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeSelect implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 节点ID */ |
| | | private Long id; |
| | | |
| | | /** 节点名称 */ |
| | | private String label; |
| | | |
| | | /** 节点禁用 */ |
| | | private boolean disabled = false; |
| | | |
| | | /** 子节点 */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | private List<TreeSelect> children; |
| | | |
| | | public TreeSelect() |
| | | { |
| | | |
| | | } |
| | | |
| | | public TreeSelect(SysDept dept) |
| | | { |
| | | this.id = dept.getDeptId(); |
| | | this.label = dept.getDeptName(); |
| | | this.disabled = StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()); |
| | | this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public TreeSelect(SysMenu menu) |
| | | { |
| | | this.id = menu.getMenuId(); |
| | | this.label = menu.getMenuName(); |
| | | this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLabel() |
| | | { |
| | | return label; |
| | | } |
| | | |
| | | public void setLabel(String label) |
| | | { |
| | | this.label = label; |
| | | } |
| | | |
| | | public boolean isDisabled() |
| | | { |
| | | return disabled; |
| | | } |
| | | |
| | | public void setDisabled(boolean disabled) |
| | | { |
| | | this.disabled = disabled; |
| | | } |
| | | |
| | | public List<TreeSelect> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<TreeSelect> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 部门表 sys_dept |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDept extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 部门ID */ |
| | | private Long deptId; |
| | | |
| | | /** 父部门ID */ |
| | | private Long parentId; |
| | | |
| | | /** 祖级列表 */ |
| | | private String ancestors; |
| | | |
| | | /** 部门名称 */ |
| | | private String deptName; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 负责人 */ |
| | | private String leader; |
| | | |
| | | /** 联系电话 */ |
| | | private String phone; |
| | | |
| | | /** 邮箱 */ |
| | | private String email; |
| | | |
| | | /** 部门状态:0正常,1停用 */ |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | private String delFlag; |
| | | |
| | | /** 父部门名称 */ |
| | | private String parentName; |
| | | |
| | | /** 子部门 */ |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | @NotBlank(message = "部门名称不能为空") |
| | | @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") |
| | | public String getDeptName() |
| | | { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) |
| | | { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getLeader() |
| | | { |
| | | return leader; |
| | | } |
| | | |
| | | public void setLeader(String leader) |
| | | { |
| | | this.leader = leader; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") |
| | | public String getPhone() |
| | | { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) |
| | | { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public List<SysDept> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysDept> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("deptId", getDeptId()) |
| | | .append("parentId", getParentId()) |
| | | .append("ancestors", getAncestors()) |
| | | .append("deptName", getDeptName()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("leader", getLeader()) |
| | | .append("phone", getPhone()) |
| | | .append("email", getEmail()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 字典数据表 sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictData extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典编码 */ |
| | | @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) |
| | | private Long dictCode; |
| | | |
| | | /** 字典排序 */ |
| | | @Excel(name = "字典排序", cellType = ColumnType.NUMERIC) |
| | | private Long dictSort; |
| | | |
| | | /** 字典标签 */ |
| | | @Excel(name = "字典标签") |
| | | private String dictLabel; |
| | | |
| | | /** 字典键值 */ |
| | | @Excel(name = "字典键值") |
| | | private String dictValue; |
| | | |
| | | /** 字典类型 */ |
| | | @Excel(name = "字典类型") |
| | | private String dictType; |
| | | |
| | | /** 样式属性(其他样式扩展) */ |
| | | private String cssClass; |
| | | |
| | | /** 表格字典样式 */ |
| | | private String listClass; |
| | | |
| | | /** 是否默认(Y是 N否) */ |
| | | @Excel(name = "是否默认", readConverterExp = "Y=是,N=否") |
| | | private String isDefault; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | @Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictCode() |
| | | { |
| | | return dictCode; |
| | | } |
| | | |
| | | public void setDictCode(Long dictCode) |
| | | { |
| | | this.dictCode = dictCode; |
| | | } |
| | | |
| | | public Long getDictSort() |
| | | { |
| | | return dictSort; |
| | | } |
| | | |
| | | public void setDictSort(Long dictSort) |
| | | { |
| | | this.dictSort = dictSort; |
| | | } |
| | | |
| | | @NotBlank(message = "字典标签不能为空") |
| | | @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") |
| | | public String getDictLabel() |
| | | { |
| | | return dictLabel; |
| | | } |
| | | |
| | | public void setDictLabel(String dictLabel) |
| | | { |
| | | this.dictLabel = dictLabel; |
| | | } |
| | | |
| | | @NotBlank(message = "字典键值不能为空") |
| | | @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") |
| | | public String getDictValue() |
| | | { |
| | | return dictValue; |
| | | } |
| | | |
| | | public void setDictValue(String dictValue) |
| | | { |
| | | this.dictValue = dictValue; |
| | | } |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") |
| | | public String getCssClass() |
| | | { |
| | | return cssClass; |
| | | } |
| | | |
| | | public void setCssClass(String cssClass) |
| | | { |
| | | this.cssClass = cssClass; |
| | | } |
| | | |
| | | public String getListClass() |
| | | { |
| | | return listClass; |
| | | } |
| | | |
| | | public void setListClass(String listClass) |
| | | { |
| | | this.listClass = listClass; |
| | | } |
| | | |
| | | public boolean getDefault() |
| | | { |
| | | return UserConstants.YES.equals(this.isDefault); |
| | | } |
| | | |
| | | public String getIsDefault() |
| | | { |
| | | return isDefault; |
| | | } |
| | | |
| | | public void setIsDefault(String isDefault) |
| | | { |
| | | this.isDefault = isDefault; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictCode", getDictCode()) |
| | | .append("dictSort", getDictSort()) |
| | | .append("dictLabel", getDictLabel()) |
| | | .append("dictValue", getDictValue()) |
| | | .append("dictType", getDictType()) |
| | | .append("cssClass", getCssClass()) |
| | | .append("listClass", getListClass()) |
| | | .append("isDefault", getIsDefault()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 字典类型表 sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictType extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典主键 */ |
| | | @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) |
| | | private Long dictId; |
| | | |
| | | /** 字典名称 */ |
| | | @Excel(name = "字典名称") |
| | | private String dictName; |
| | | |
| | | /** 字典类型 */ |
| | | @Excel(name = "字典类型") |
| | | private String dictType; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | @Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictId() |
| | | { |
| | | return dictId; |
| | | } |
| | | |
| | | public void setDictId(Long dictId) |
| | | { |
| | | this.dictId = dictId; |
| | | } |
| | | |
| | | @NotBlank(message = "字典名称不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") |
| | | public String getDictName() |
| | | { |
| | | return dictName; |
| | | } |
| | | |
| | | public void setDictName(String dictName) |
| | | { |
| | | this.dictName = dictName; |
| | | } |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") |
| | | @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictId", getDictId()) |
| | | .append("dictName", getDictName()) |
| | | .append("dictType", getDictType()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 菜单权限表 sys_menu |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysMenu extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 菜单ID */ |
| | | private Long menuId; |
| | | |
| | | /** 菜单名称 */ |
| | | private String menuName; |
| | | |
| | | /** 父菜单名称 */ |
| | | private String parentName; |
| | | |
| | | /** 父菜单ID */ |
| | | private Long parentId; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 路由地址 */ |
| | | private String path; |
| | | |
| | | /** 组件路径 */ |
| | | private String component; |
| | | |
| | | /** 路由参数 */ |
| | | private String query; |
| | | |
| | | /** 路由名称,默认和路由地址相同的驼峰格式(注意:因为vue3版本的router会删除名称相同路由,为避免名字的冲突,特殊情况可以自定义) */ |
| | | private String routeName; |
| | | |
| | | /** 是否为外链(0是 1否) */ |
| | | private String isFrame; |
| | | |
| | | /** 是否缓存(0缓存 1不缓存) */ |
| | | private String isCache; |
| | | |
| | | /** 类型(M目录 C菜单 F按钮) */ |
| | | private String menuType; |
| | | |
| | | /** 显示状态(0显示 1隐藏) */ |
| | | private String visible; |
| | | |
| | | /** 菜单状态(0正常 1停用) */ |
| | | private String status; |
| | | |
| | | /** 权限字符串 */ |
| | | private String perms; |
| | | |
| | | /** 菜单图标 */ |
| | | private String icon; |
| | | |
| | | /** 子菜单 */ |
| | | private List<SysMenu> children = new ArrayList<SysMenu>(); |
| | | |
| | | public Long getMenuId() |
| | | { |
| | | return menuId; |
| | | } |
| | | |
| | | public void setMenuId(Long menuId) |
| | | { |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单名称不能为空") |
| | | @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") |
| | | public String getMenuName() |
| | | { |
| | | return menuName; |
| | | } |
| | | |
| | | public void setMenuName(String menuName) |
| | | { |
| | | this.menuName = menuName; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") |
| | | public String getPath() |
| | | { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) |
| | | { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") |
| | | public String getComponent() |
| | | { |
| | | return component; |
| | | } |
| | | |
| | | public void setComponent(String component) |
| | | { |
| | | this.component = component; |
| | | } |
| | | |
| | | public String getQuery() |
| | | { |
| | | return query; |
| | | } |
| | | |
| | | public void setQuery(String query) |
| | | { |
| | | this.query = query; |
| | | } |
| | | |
| | | public String getRouteName() |
| | | { |
| | | return routeName; |
| | | } |
| | | |
| | | public void setRouteName(String routeName) |
| | | { |
| | | this.routeName = routeName; |
| | | } |
| | | |
| | | public String getIsFrame() |
| | | { |
| | | return isFrame; |
| | | } |
| | | |
| | | public void setIsFrame(String isFrame) |
| | | { |
| | | this.isFrame = isFrame; |
| | | } |
| | | |
| | | public String getIsCache() |
| | | { |
| | | return isCache; |
| | | } |
| | | |
| | | public void setIsCache(String isCache) |
| | | { |
| | | this.isCache = isCache; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单类型不能为空") |
| | | public String getMenuType() |
| | | { |
| | | return menuType; |
| | | } |
| | | |
| | | public void setMenuType(String menuType) |
| | | { |
| | | this.menuType = menuType; |
| | | } |
| | | |
| | | public String getVisible() |
| | | { |
| | | return visible; |
| | | } |
| | | |
| | | public void setVisible(String visible) |
| | | { |
| | | this.visible = visible; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") |
| | | public String getPerms() |
| | | { |
| | | return perms; |
| | | } |
| | | |
| | | public void setPerms(String perms) |
| | | { |
| | | this.perms = perms; |
| | | } |
| | | |
| | | public String getIcon() |
| | | { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) |
| | | { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | public List<SysMenu> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysMenu> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("menuId", getMenuId()) |
| | | .append("menuName", getMenuName()) |
| | | .append("parentId", getParentId()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("path", getPath()) |
| | | .append("component", getComponent()) |
| | | .append("query", getQuery()) |
| | | .append("routeName", getRouteName()) |
| | | .append("isFrame", getIsFrame()) |
| | | .append("IsCache", getIsCache()) |
| | | .append("menuType", getMenuType()) |
| | | .append("visible", getVisible()) |
| | | .append("status ", getStatus()) |
| | | .append("perms", getPerms()) |
| | | .append("icon", getIcon()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.Set; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 角色表 sys_role |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysRole extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 角色ID */ |
| | | @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | private Long roleId; |
| | | |
| | | /** 角色名称 */ |
| | | @Excel(name = "角色名称") |
| | | private String roleName; |
| | | |
| | | /** 角色权限 */ |
| | | @Excel(name = "角色权限") |
| | | private String roleKey; |
| | | |
| | | /** 角色排序 */ |
| | | @Excel(name = "角色排序") |
| | | private Integer roleSort; |
| | | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | private String dataScope; |
| | | |
| | | /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ |
| | | private boolean menuCheckStrictly; |
| | | |
| | | /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ |
| | | private boolean deptCheckStrictly; |
| | | |
| | | /** 角色状态(0正常 1停用) */ |
| | | @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | private String delFlag; |
| | | |
| | | /** 用户是否存在此角色标识 默认不存在 */ |
| | | private boolean flag = false; |
| | | |
| | | /** 菜单组 */ |
| | | private Long[] menuIds; |
| | | |
| | | /** 部门组(数据权限) */ |
| | | private Long[] deptIds; |
| | | |
| | | /** 角色菜单权限 */ |
| | | private Set<String> permissions; |
| | | |
| | | public SysRole() |
| | | { |
| | | |
| | | } |
| | | |
| | | public SysRole(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public Long getRoleId() |
| | | { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() |
| | | { |
| | | return isAdmin(this.roleId); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long roleId) |
| | | { |
| | | return roleId != null && 1L == roleId; |
| | | } |
| | | |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | public String getRoleName() |
| | | { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) |
| | | { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | public String getRoleKey() |
| | | { |
| | | return roleKey; |
| | | } |
| | | |
| | | public void setRoleKey(String roleKey) |
| | | { |
| | | this.roleKey = roleKey; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | public Integer getRoleSort() |
| | | { |
| | | return roleSort; |
| | | } |
| | | |
| | | public void setRoleSort(Integer roleSort) |
| | | { |
| | | this.roleSort = roleSort; |
| | | } |
| | | |
| | | public String getDataScope() |
| | | { |
| | | return dataScope; |
| | | } |
| | | |
| | | public void setDataScope(String dataScope) |
| | | { |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public boolean isMenuCheckStrictly() |
| | | { |
| | | return menuCheckStrictly; |
| | | } |
| | | |
| | | public void setMenuCheckStrictly(boolean menuCheckStrictly) |
| | | { |
| | | this.menuCheckStrictly = menuCheckStrictly; |
| | | } |
| | | |
| | | public boolean isDeptCheckStrictly() |
| | | { |
| | | return deptCheckStrictly; |
| | | } |
| | | |
| | | public void setDeptCheckStrictly(boolean deptCheckStrictly) |
| | | { |
| | | this.deptCheckStrictly = deptCheckStrictly; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public boolean isFlag() |
| | | { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(boolean flag) |
| | | { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getMenuIds() |
| | | { |
| | | return menuIds; |
| | | } |
| | | |
| | | public void setMenuIds(Long[] menuIds) |
| | | { |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getDeptIds() |
| | | { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(Long[] deptIds) |
| | | { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public Set<String> getPermissions() |
| | | { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) |
| | | { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("roleId", getRoleId()) |
| | | .append("roleName", getRoleName()) |
| | | .append("roleKey", getRoleKey()) |
| | | .append("roleSort", getRoleSort()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("menuCheckStrictly", isMenuCheckStrictly()) |
| | | .append("deptCheckStrictly", isDeptCheckStrictly()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.annotation.Excel.Type; |
| | | import com.ruoyi.common.annotation.Excels; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.xss.Xss; |
| | | |
| | | /** |
| | | * 用户对象 sys_user |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUser extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty(value = "用户id") |
| | | @Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | @Excel(name = "部门编号", type = Type.IMPORT) |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 用户账号 |
| | | */ |
| | | @ApiModelProperty(value = "账号") |
| | | @Excel(name = "登录名称") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | @ApiModelProperty(value = "账号名称") |
| | | @Excel(name = "用户名称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 用户邮箱 |
| | | */ |
| | | @Excel(name = "用户邮箱") |
| | | private String email; |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | @Excel(name = "手机号码", cellType = ColumnType.TEXT) |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * 用户性别 |
| | | */ |
| | | @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String password; |
| | | |
| | | /** |
| | | * 帐号状态(0正常 1停用) |
| | | */ |
| | | @ApiModelProperty(value = "账号状态 0=正常,1=停用") |
| | | @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * 最后登录IP |
| | | */ |
| | | @Excel(name = "最后登录IP", type = Type.EXPORT) |
| | | private String loginIp; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) |
| | | private Date loginDate; |
| | | |
| | | /** |
| | | * 部门对象 |
| | | */ |
| | | @Excels({ |
| | | @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), |
| | | @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) |
| | | }) |
| | | private SysDept dept; |
| | | |
| | | /** |
| | | * 角色对象 |
| | | */ |
| | | private List<SysRole> roles; |
| | | |
| | | /** |
| | | * 角色组 |
| | | */ |
| | | private Long[] roleIds; |
| | | |
| | | /** |
| | | * 岗位组 |
| | | */ |
| | | private Long[] postIds; |
| | | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | private Long roleId; |
| | | |
| | | public SysUser() { |
| | | |
| | | } |
| | | |
| | | public SysUser(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return isAdmin(this.userId); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long userId) { |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Xss(message = "用户昵称不能包含脚本字符") |
| | | @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | @Xss(message = "用户账号不能包含脚本字符") |
| | | @NotBlank(message = "用户账号不能为空") |
| | | @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") |
| | | public String getPhonenumber() { |
| | | return phonenumber; |
| | | } |
| | | |
| | | public void setPhonenumber(String phonenumber) { |
| | | this.phonenumber = phonenumber; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getAvatar() { |
| | | return avatar; |
| | | } |
| | | |
| | | public void setAvatar(String avatar) { |
| | | this.avatar = avatar; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getLoginIp() { |
| | | return loginIp; |
| | | } |
| | | |
| | | public void setLoginIp(String loginIp) { |
| | | this.loginIp = loginIp; |
| | | } |
| | | |
| | | public Date getLoginDate() { |
| | | return loginDate; |
| | | } |
| | | |
| | | public void setLoginDate(Date loginDate) { |
| | | this.loginDate = loginDate; |
| | | } |
| | | |
| | | public SysDept getDept() { |
| | | return dept; |
| | | } |
| | | |
| | | public void setDept(SysDept dept) { |
| | | this.dept = dept; |
| | | } |
| | | |
| | | public List<SysRole> getRoles() { |
| | | return roles; |
| | | } |
| | | |
| | | public void setRoles(List<SysRole> roles) { |
| | | this.roles = roles; |
| | | } |
| | | |
| | | public Long[] getRoleIds() { |
| | | return roleIds; |
| | | } |
| | | |
| | | public void setRoleIds(Long[] roleIds) { |
| | | this.roleIds = roleIds; |
| | | } |
| | | |
| | | public Long[] getPostIds() { |
| | | return postIds; |
| | | } |
| | | |
| | | public void setPostIds(Long[] postIds) { |
| | | this.postIds = postIds; |
| | | } |
| | | |
| | | public Long getRoleId() { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("userId", getUserId()) |
| | | .append("deptId", getDeptId()) |
| | | .append("userName", getUserName()) |
| | | .append("nickName", getNickName()) |
| | | .append("email", getEmail()) |
| | | .append("phonenumber", getPhonenumber()) |
| | | .append("sex", getSex()) |
| | | .append("avatar", getAvatar()) |
| | | .append("password", getPassword()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("loginIp", getLoginIp()) |
| | | .append("loginDate", getLoginDate()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .append("dept", getDept()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 用户登录对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class LoginBody { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @ApiModelProperty(value = "用户名称") |
| | | private String username; |
| | | |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | @ApiModelProperty(value = "用户密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 验证码 |
| | | */ |
| | | @ApiModelProperty(value = "验证码") |
| | | private String code; |
| | | |
| | | /** |
| | | * 唯一标识 |
| | | */ |
| | | @ApiModelProperty(value = "验证码接口UUID") |
| | | private String uuid; |
| | | |
| | | public String getUsername() { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import java.util.Collection; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 登录用户身份权限 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class LoginUser implements UserDetails |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 用户唯一标识 |
| | | */ |
| | | private String token; |
| | | |
| | | /** |
| | | * 登录时间 |
| | | */ |
| | | private Long loginTime; |
| | | |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | private Long expireTime; |
| | | |
| | | /** |
| | | * 登录IP地址 |
| | | */ |
| | | private String ipaddr; |
| | | |
| | | /** |
| | | * 登录地点 |
| | | */ |
| | | private String loginLocation; |
| | | |
| | | /** |
| | | * 浏览器类型 |
| | | */ |
| | | private String browser; |
| | | |
| | | /** |
| | | * 操作系统 |
| | | */ |
| | | private String os; |
| | | |
| | | /** |
| | | * 权限列表 |
| | | */ |
| | | private Set<String> permissions; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | */ |
| | | private SysUser user; |
| | | |
| | | public LoginUser() |
| | | { |
| | | } |
| | | |
| | | public LoginUser(SysUser user, Set<String> permissions) |
| | | { |
| | | this.user = user; |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions) |
| | | { |
| | | this.userId = userId; |
| | | this.deptId = deptId; |
| | | this.user = user; |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public Long getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getToken() |
| | | { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) |
| | | { |
| | | this.token = token; |
| | | } |
| | | |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public String getPassword() |
| | | { |
| | | return user.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public String getUsername() |
| | | { |
| | | return user.getUserName(); |
| | | } |
| | | |
| | | /** |
| | | * 账户是否未过期,过期无法验证 |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isAccountNonExpired() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 指定用户是否解锁,锁定的用户无法进行身份验证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isAccountNonLocked() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isCredentialsNonExpired() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 是否可用 ,禁用的用户不能身份验证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isEnabled() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | public Long getLoginTime() |
| | | { |
| | | return loginTime; |
| | | } |
| | | |
| | | public void setLoginTime(Long loginTime) |
| | | { |
| | | this.loginTime = loginTime; |
| | | } |
| | | |
| | | public String getIpaddr() |
| | | { |
| | | return ipaddr; |
| | | } |
| | | |
| | | public void setIpaddr(String ipaddr) |
| | | { |
| | | this.ipaddr = ipaddr; |
| | | } |
| | | |
| | | public String getLoginLocation() |
| | | { |
| | | return loginLocation; |
| | | } |
| | | |
| | | public void setLoginLocation(String loginLocation) |
| | | { |
| | | this.loginLocation = loginLocation; |
| | | } |
| | | |
| | | public String getBrowser() |
| | | { |
| | | return browser; |
| | | } |
| | | |
| | | public void setBrowser(String browser) |
| | | { |
| | | this.browser = browser; |
| | | } |
| | | |
| | | public String getOs() |
| | | { |
| | | return os; |
| | | } |
| | | |
| | | public void setOs(String os) |
| | | { |
| | | this.os = os; |
| | | } |
| | | |
| | | public Long getExpireTime() |
| | | { |
| | | return expireTime; |
| | | } |
| | | |
| | | public void setExpireTime(Long expireTime) |
| | | { |
| | | this.expireTime = expireTime; |
| | | } |
| | | |
| | | public Set<String> getPermissions() |
| | | { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) |
| | | { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public SysUser getUser() |
| | | { |
| | | return user; |
| | | } |
| | | |
| | | public void setUser(SysUser user) |
| | | { |
| | | this.user = user; |
| | | } |
| | | |
| | | @Override |
| | | public Collection<? extends GrantedAuthority> getAuthorities() |
| | | { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | /** |
| | | * 用户注册对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RegisterBody extends LoginBody |
| | | { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.page; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 分页数据 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class PageDomain |
| | | { |
| | | /** 当前记录起始索引 */ |
| | | @ApiModelProperty(value = "当前页") |
| | | private Integer pageNum; |
| | | |
| | | /** 每页显示记录数 */ |
| | | @ApiModelProperty(value = "记录数") |
| | | private Integer pageSize; |
| | | |
| | | /** 排序列 */ |
| | | private String orderByColumn; |
| | | |
| | | /** 排序的方向desc或者asc */ |
| | | private String isAsc = "asc"; |
| | | |
| | | /** 分页参数合理化 */ |
| | | private Boolean reasonable = true; |
| | | |
| | | public String getOrderBy() |
| | | { |
| | | if (StringUtils.isEmpty(orderByColumn)) |
| | | { |
| | | return ""; |
| | | } |
| | | return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; |
| | | } |
| | | |
| | | public Integer getPageNum() |
| | | { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(Integer pageNum) |
| | | { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public Integer getPageSize() |
| | | { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) |
| | | { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getOrderByColumn() |
| | | { |
| | | return orderByColumn; |
| | | } |
| | | |
| | | public void setOrderByColumn(String orderByColumn) |
| | | { |
| | | this.orderByColumn = orderByColumn; |
| | | } |
| | | |
| | | public String getIsAsc() |
| | | { |
| | | return isAsc; |
| | | } |
| | | |
| | | public void setIsAsc(String isAsc) |
| | | { |
| | | if (StringUtils.isNotEmpty(isAsc)) |
| | | { |
| | | // 兼容前端排序类型 |
| | | if ("ascending".equals(isAsc)) |
| | | { |
| | | isAsc = "asc"; |
| | | } |
| | | else if ("descending".equals(isAsc)) |
| | | { |
| | | isAsc = "desc"; |
| | | } |
| | | this.isAsc = isAsc; |
| | | } |
| | | } |
| | | |
| | | public Boolean getReasonable() |
| | | { |
| | | if (StringUtils.isNull(reasonable)) |
| | | { |
| | | return Boolean.TRUE; |
| | | } |
| | | return reasonable; |
| | | } |
| | | |
| | | public void setReasonable(Boolean reasonable) |
| | | { |
| | | this.reasonable = reasonable; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.page; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表格分页数据对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableDataInfo implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 总记录数 */ |
| | | private long total; |
| | | |
| | | /** 列表数据 */ |
| | | private List<?> rows; |
| | | |
| | | /** 消息状态码 */ |
| | | private int code; |
| | | |
| | | /** 消息内容 */ |
| | | private String msg; |
| | | |
| | | /** |
| | | * 表格数据对象 |
| | | */ |
| | | public TableDataInfo() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<?> list, long total) |
| | | { |
| | | this.rows = list; |
| | | this.total = total; |
| | | } |
| | | |
| | | public long getTotal() |
| | | { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) |
| | | { |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<?> getRows() |
| | | { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(List<?> rows) |
| | | { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | public int getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.page; |
| | | |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | |
| | | /** |
| | | * 表格数据处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableSupport |
| | | { |
| | | /** |
| | | * 当前记录起始索引 |
| | | */ |
| | | public static final String PAGE_NUM = "pageNum"; |
| | | |
| | | /** |
| | | * 每页显示记录数 |
| | | */ |
| | | public static final String PAGE_SIZE = "pageSize"; |
| | | |
| | | /** |
| | | * 排序列 |
| | | */ |
| | | public static final String ORDER_BY_COLUMN = "orderByColumn"; |
| | | |
| | | /** |
| | | * 排序的方向 "desc" 或者 "asc". |
| | | */ |
| | | public static final String IS_ASC = "isAsc"; |
| | | |
| | | /** |
| | | * 分页参数合理化 |
| | | */ |
| | | public static final String REASONABLE = "reasonable"; |
| | | |
| | | /** |
| | | * 封装分页对象 |
| | | */ |
| | | public static PageDomain getPageDomain() |
| | | { |
| | | PageDomain pageDomain = new PageDomain(); |
| | | pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); |
| | | pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); |
| | | pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); |
| | | pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); |
| | | pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); |
| | | return pageDomain; |
| | | } |
| | | |
| | | public static PageDomain buildPageRequest() |
| | | { |
| | | return getPageDomain(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.redis; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.BoundSetOperations; |
| | | import org.springframework.data.redis.core.HashOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * spring redis 工具类 |
| | | * |
| | | * @author ruoyi |
| | | **/ |
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" }) |
| | | @Component |
| | | public class RedisCache |
| | | { |
| | | @Autowired |
| | | public RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 缓存基本的对象,Integer、String、实体类等 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param value 缓存的值 |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value); |
| | | } |
| | | |
| | | /** |
| | | * 缓存基本的对象,Integer、String、实体类等 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param value 缓存的值 |
| | | * @param timeout 时间 |
| | | * @param timeUnit 时间颗粒度 |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value, timeout, timeUnit); |
| | | } |
| | | |
| | | /** |
| | | * 设置有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @param timeout 超时时间 |
| | | * @return true=设置成功;false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout) |
| | | { |
| | | return expire(key, timeout, TimeUnit.SECONDS); |
| | | } |
| | | |
| | | /** |
| | | * 设置有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @param timeout 超时时间 |
| | | * @param unit 时间单位 |
| | | * @return true=设置成功;false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout, final TimeUnit unit) |
| | | { |
| | | return redisTemplate.expire(key, timeout, unit); |
| | | } |
| | | |
| | | /** |
| | | * 获取有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @return 有效时间 |
| | | */ |
| | | public long getExpire(final String key) |
| | | { |
| | | return redisTemplate.getExpire(key); |
| | | } |
| | | |
| | | /** |
| | | * 判断 key是否存在 |
| | | * |
| | | * @param key 键 |
| | | * @return true 存在 false不存在 |
| | | */ |
| | | public Boolean hasKey(String key) |
| | | { |
| | | return redisTemplate.hasKey(key); |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的基本对象。 |
| | | * |
| | | * @param key 缓存键值 |
| | | * @return 缓存键值对应的数据 |
| | | */ |
| | | public <T> T getCacheObject(final String key) |
| | | { |
| | | ValueOperations<String, T> operation = redisTemplate.opsForValue(); |
| | | return operation.get(key); |
| | | } |
| | | |
| | | /** |
| | | * 删除单个对象 |
| | | * |
| | | * @param key |
| | | */ |
| | | public boolean deleteObject(final String key) |
| | | { |
| | | return redisTemplate.delete(key); |
| | | } |
| | | |
| | | /** |
| | | * 删除集合对象 |
| | | * |
| | | * @param collection 多个对象 |
| | | * @return |
| | | */ |
| | | public boolean deleteObject(final Collection collection) |
| | | { |
| | | return redisTemplate.delete(collection) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 缓存List数据 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param dataList 待缓存的List数据 |
| | | * @return 缓存的对象 |
| | | */ |
| | | public <T> long setCacheList(final String key, final List<T> dataList) |
| | | { |
| | | Long count = redisTemplate.opsForList().rightPushAll(key, dataList); |
| | | return count == null ? 0 : count; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的list对象 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @return 缓存键值对应的数据 |
| | | */ |
| | | public <T> List<T> getCacheList(final String key) |
| | | { |
| | | return redisTemplate.opsForList().range(key, 0, -1); |
| | | } |
| | | |
| | | /** |
| | | * 缓存Set |
| | | * |
| | | * @param key 缓存键值 |
| | | * @param dataSet 缓存的数据 |
| | | * @return 缓存数据的对象 |
| | | */ |
| | | public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet) |
| | | { |
| | | BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key); |
| | | Iterator<T> it = dataSet.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | setOperation.add(it.next()); |
| | | } |
| | | return setOperation; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的set |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Set<T> getCacheSet(final String key) |
| | | { |
| | | return redisTemplate.opsForSet().members(key); |
| | | } |
| | | |
| | | /** |
| | | * 缓存Map |
| | | * |
| | | * @param key |
| | | * @param dataMap |
| | | */ |
| | | public <T> void setCacheMap(final String key, final Map<String, T> dataMap) |
| | | { |
| | | if (dataMap != null) { |
| | | redisTemplate.opsForHash().putAll(key, dataMap); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的Map |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Map<String, T> getCacheMap(final String key) |
| | | { |
| | | return redisTemplate.opsForHash().entries(key); |
| | | } |
| | | |
| | | /** |
| | | * 往Hash中存入数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @param value 值 |
| | | */ |
| | | public <T> void setCacheMapValue(final String key, final String hKey, final T value) |
| | | { |
| | | redisTemplate.opsForHash().put(key, hKey, value); |
| | | } |
| | | |
| | | /** |
| | | * 获取Hash中的数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @return Hash中的对象 |
| | | */ |
| | | public <T> T getCacheMapValue(final String key, final String hKey) |
| | | { |
| | | HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash(); |
| | | return opsForHash.get(key, hKey); |
| | | } |
| | | |
| | | /** |
| | | * 获取多个Hash中的数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKeys Hash键集合 |
| | | * @return Hash对象集合 |
| | | */ |
| | | public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) |
| | | { |
| | | return redisTemplate.opsForHash().multiGet(key, hKeys); |
| | | } |
| | | |
| | | /** |
| | | * 删除Hash中的某条数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean deleteCacheMapValue(final String key, final String hKey) |
| | | { |
| | | return redisTemplate.opsForHash().delete(key, hKey) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的基本对象列表 |
| | | * |
| | | * @param pattern 字符串前缀 |
| | | * @return 对象列表 |
| | | */ |
| | | public Collection<String> keys(final String pattern) |
| | | { |
| | | return redisTemplate.keys(pattern); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.text; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.nio.charset.StandardCharsets; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 字符集工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CharsetKit |
| | | { |
| | | /** ISO-8859-1 */ |
| | | public static final String ISO_8859_1 = "ISO-8859-1"; |
| | | /** UTF-8 */ |
| | | public static final String UTF_8 = "UTF-8"; |
| | | /** GBK */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** ISO-8859-1 */ |
| | | public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); |
| | | /** UTF-8 */ |
| | | public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); |
| | | /** GBK */ |
| | | public static final Charset CHARSET_GBK = Charset.forName(GBK); |
| | | |
| | | /** |
| | | * 转换为Charset对象 |
| | | * |
| | | * @param charset 字符集,为空则返回默认字符集 |
| | | * @return Charset |
| | | */ |
| | | public static Charset charset(String charset) |
| | | { |
| | | return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); |
| | | } |
| | | |
| | | /** |
| | | * 转换字符串的字符集编码 |
| | | * |
| | | * @param source 字符串 |
| | | * @param srcCharset 源字符集,默认ISO-8859-1 |
| | | * @param destCharset 目标字符集,默认UTF-8 |
| | | * @return 转换后的字符集 |
| | | */ |
| | | public static String convert(String source, String srcCharset, String destCharset) |
| | | { |
| | | return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); |
| | | } |
| | | |
| | | /** |
| | | * 转换字符串的字符集编码 |
| | | * |
| | | * @param source 字符串 |
| | | * @param srcCharset 源字符集,默认ISO-8859-1 |
| | | * @param destCharset 目标字符集,默认UTF-8 |
| | | * @return 转换后的字符集 |
| | | */ |
| | | public static String convert(String source, Charset srcCharset, Charset destCharset) |
| | | { |
| | | if (null == srcCharset) |
| | | { |
| | | srcCharset = StandardCharsets.ISO_8859_1; |
| | | } |
| | | |
| | | if (null == destCharset) |
| | | { |
| | | destCharset = StandardCharsets.UTF_8; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) |
| | | { |
| | | return source; |
| | | } |
| | | return new String(source.getBytes(srcCharset), destCharset); |
| | | } |
| | | |
| | | /** |
| | | * @return 系统字符集编码 |
| | | */ |
| | | public static String systemCharset() |
| | | { |
| | | return Charset.defaultCharset().name(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.text; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.charset.Charset; |
| | | import java.text.NumberFormat; |
| | | import java.util.Set; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | |
| | | /** |
| | | * 类型转换器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Convert |
| | | { |
| | | /** |
| | | * 转换为字符串<br> |
| | | * 如果给定的值为null,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static String toStr(Object value, String defaultValue) |
| | | { |
| | | if (null == value) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof String) |
| | | { |
| | | return (String) value; |
| | | } |
| | | return value.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符串<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String toStr(Object value) |
| | | { |
| | | return toStr(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符<br> |
| | | * 如果给定的值为null,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Character toChar(Object value, Character defaultValue) |
| | | { |
| | | if (null == value) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Character) |
| | | { |
| | | return (Character) value; |
| | | } |
| | | |
| | | final String valueStr = toStr(value, null); |
| | | return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Character toChar(Object value) |
| | | { |
| | | return toChar(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为byte<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Byte toByte(Object value, Byte defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Byte) |
| | | { |
| | | return (Byte) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).byteValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Byte.parseByte(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为byte<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Byte toByte(Object value) |
| | | { |
| | | return toByte(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Short<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Short toShort(Object value, Short defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Short) |
| | | { |
| | | return (Short) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).shortValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Short.parseShort(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Short<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Short toShort(Object value) |
| | | { |
| | | return toShort(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Number<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Number toNumber(Object value, Number defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return (Number) value; |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return NumberFormat.getInstance().parse(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Number<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Number toNumber(Object value) |
| | | { |
| | | return toNumber(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为int<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer toInt(Object value, Integer defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Integer) |
| | | { |
| | | return (Integer) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).intValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Integer.parseInt(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为int<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer toInt(Object value) |
| | | { |
| | | return toInt(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Integer数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer[] toIntArray(String str) |
| | | { |
| | | return toIntArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Long数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long[] toLongArray(String str) |
| | | { |
| | | return toLongArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Integer数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param split 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer[] toIntArray(String split, String str) |
| | | { |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return new Integer[] {}; |
| | | } |
| | | String[] arr = str.split(split); |
| | | final Integer[] ints = new Integer[arr.length]; |
| | | for (int i = 0; i < arr.length; i++) |
| | | { |
| | | final Integer v = toInt(arr[i], 0); |
| | | ints[i] = v; |
| | | } |
| | | return ints; |
| | | } |
| | | |
| | | /** |
| | | * 转换为Long数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long[] toLongArray(String split, String str) |
| | | { |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return new Long[] {}; |
| | | } |
| | | String[] arr = str.split(split); |
| | | final Long[] longs = new Long[arr.length]; |
| | | for (int i = 0; i < arr.length; i++) |
| | | { |
| | | final Long v = toLong(arr[i], null); |
| | | longs[i] = v; |
| | | } |
| | | return longs; |
| | | } |
| | | |
| | | /** |
| | | * 转换为String数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String[] toStrArray(String str) |
| | | { |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return new String[] {}; |
| | | } |
| | | return toStrArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为String数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param split 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String[] toStrArray(String split, String str) |
| | | { |
| | | return str.split(split); |
| | | } |
| | | |
| | | /** |
| | | * 转换为long<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long toLong(Object value, Long defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return (Long) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).longValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | // 支持科学计数法 |
| | | return new BigDecimal(valueStr.trim()).longValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为long<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long toLong(Object value) |
| | | { |
| | | return toLong(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为double<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Double toDouble(Object value, Double defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Double) |
| | | { |
| | | return (Double) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).doubleValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | // 支持科学计数法 |
| | | return new BigDecimal(valueStr.trim()).doubleValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为double<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Double toDouble(Object value) |
| | | { |
| | | return toDouble(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Float<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Float toFloat(Object value, Float defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Float) |
| | | { |
| | | return (Float) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).floatValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Float.parseFloat(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Float<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Float toFloat(Object value) |
| | | { |
| | | return toFloat(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为boolean<br> |
| | | * String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Boolean toBool(Object value, Boolean defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Boolean) |
| | | { |
| | | return (Boolean) value; |
| | | } |
| | | String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | valueStr = valueStr.trim().toLowerCase(); |
| | | switch (valueStr) |
| | | { |
| | | case "true": |
| | | case "yes": |
| | | case "ok": |
| | | case "1": |
| | | case "是": |
| | | return true; |
| | | case "false": |
| | | case "no": |
| | | case "0": |
| | | case "否": |
| | | return false; |
| | | default: |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为boolean<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Boolean toBool(Object value) |
| | | { |
| | | return toBool(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Enum对象<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * |
| | | * @param clazz Enum的Class |
| | | * @param value 值 |
| | | * @param defaultValue 默认值 |
| | | * @return Enum |
| | | */ |
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (clazz.isAssignableFrom(value.getClass())) |
| | | { |
| | | @SuppressWarnings("unchecked") |
| | | E myE = (E) value; |
| | | return myE; |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Enum.valueOf(clazz, valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Enum对象<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * |
| | | * @param clazz Enum的Class |
| | | * @param value 值 |
| | | * @return Enum |
| | | */ |
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) |
| | | { |
| | | return toEnum(clazz, value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigInteger<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigInteger toBigInteger(Object value, BigInteger defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof BigInteger) |
| | | { |
| | | return (BigInteger) value; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return BigInteger.valueOf((Long) value); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return new BigInteger(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigInteger<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigInteger toBigInteger(Object value) |
| | | { |
| | | return toBigInteger(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigDecimal<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof BigDecimal) |
| | | { |
| | | return (BigDecimal) value; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return new BigDecimal((Long) value); |
| | | } |
| | | if (value instanceof Double) |
| | | { |
| | | return BigDecimal.valueOf((Double) value); |
| | | } |
| | | if (value instanceof Integer) |
| | | { |
| | | return new BigDecimal((Integer) value); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return new BigDecimal(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigDecimal<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigDecimal toBigDecimal(Object value) |
| | | { |
| | | return toBigDecimal(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @return 字符串 |
| | | */ |
| | | public static String utf8Str(Object obj) |
| | | { |
| | | return str(obj, CharsetKit.CHARSET_UTF_8); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @param charsetName 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(Object obj, String charsetName) |
| | | { |
| | | return str(obj, Charset.forName(charsetName)); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @param charset 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(Object obj, Charset charset) |
| | | { |
| | | if (null == obj) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (obj instanceof String) |
| | | { |
| | | return (String) obj; |
| | | } |
| | | else if (obj instanceof byte[]) |
| | | { |
| | | return str((byte[]) obj, charset); |
| | | } |
| | | else if (obj instanceof Byte[]) |
| | | { |
| | | byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); |
| | | return str(bytes, charset); |
| | | } |
| | | else if (obj instanceof ByteBuffer) |
| | | { |
| | | return str((ByteBuffer) obj, charset); |
| | | } |
| | | return obj.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 将byte数组转为字符串 |
| | | * |
| | | * @param bytes byte数组 |
| | | * @param charset 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(byte[] bytes, String charset) |
| | | { |
| | | return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); |
| | | } |
| | | |
| | | /** |
| | | * 解码字节码 |
| | | * |
| | | * @param data 字符串 |
| | | * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 |
| | | * @return 解码后的字符串 |
| | | */ |
| | | public static String str(byte[] data, Charset charset) |
| | | { |
| | | if (data == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (null == charset) |
| | | { |
| | | return new String(data); |
| | | } |
| | | return new String(data, charset); |
| | | } |
| | | |
| | | /** |
| | | * 将编码的byteBuffer数据转换为字符串 |
| | | * |
| | | * @param data 数据 |
| | | * @param charset 字符集,如果为空使用当前系统字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(ByteBuffer data, String charset) |
| | | { |
| | | if (data == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return str(data, Charset.forName(charset)); |
| | | } |
| | | |
| | | /** |
| | | * 将编码的byteBuffer数据转换为字符串 |
| | | * |
| | | * @param data 数据 |
| | | * @param charset 字符集,如果为空使用当前系统字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(ByteBuffer data, Charset charset) |
| | | { |
| | | if (null == charset) |
| | | { |
| | | charset = Charset.defaultCharset(); |
| | | } |
| | | return charset.decode(data).toString(); |
| | | } |
| | | |
| | | // ----------------------------------------------------------------------- 全角半角转换 |
| | | /** |
| | | * 半角转全角 |
| | | * |
| | | * @param input String. |
| | | * @return 全角字符串. |
| | | */ |
| | | public static String toSBC(String input) |
| | | { |
| | | return toSBC(input, null); |
| | | } |
| | | |
| | | /** |
| | | * 半角转全角 |
| | | * |
| | | * @param input String |
| | | * @param notConvertSet 不替换的字符集合 |
| | | * @return 全角字符串. |
| | | */ |
| | | public static String toSBC(String input, Set<Character> notConvertSet) |
| | | { |
| | | char[] c = input.toCharArray(); |
| | | for (int i = 0; i < c.length; i++) |
| | | { |
| | | if (null != notConvertSet && notConvertSet.contains(c[i])) |
| | | { |
| | | // 跳过不替换的字符 |
| | | continue; |
| | | } |
| | | |
| | | if (c[i] == ' ') |
| | | { |
| | | c[i] = '\u3000'; |
| | | } |
| | | else if (c[i] < '\177') |
| | | { |
| | | c[i] = (char) (c[i] + 65248); |
| | | |
| | | } |
| | | } |
| | | return new String(c); |
| | | } |
| | | |
| | | /** |
| | | * 全角转半角 |
| | | * |
| | | * @param input String. |
| | | * @return 半角字符串 |
| | | */ |
| | | public static String toDBC(String input) |
| | | { |
| | | return toDBC(input, null); |
| | | } |
| | | |
| | | /** |
| | | * 替换全角为半角 |
| | | * |
| | | * @param text 文本 |
| | | * @param notConvertSet 不替换的字符集合 |
| | | * @return 替换后的字符 |
| | | */ |
| | | public static String toDBC(String text, Set<Character> notConvertSet) |
| | | { |
| | | char[] c = text.toCharArray(); |
| | | for (int i = 0; i < c.length; i++) |
| | | { |
| | | if (null != notConvertSet && notConvertSet.contains(c[i])) |
| | | { |
| | | // 跳过不替换的字符 |
| | | continue; |
| | | } |
| | | |
| | | if (c[i] == '\u3000') |
| | | { |
| | | c[i] = ' '; |
| | | } |
| | | else if (c[i] > '\uFF00' && c[i] < '\uFF5F') |
| | | { |
| | | c[i] = (char) (c[i] - 65248); |
| | | } |
| | | } |
| | | String returnString = new String(c); |
| | | |
| | | return returnString; |
| | | } |
| | | |
| | | /** |
| | | * 数字金额大写转换 先写个完整的然后将如零拾替换成零 |
| | | * |
| | | * @param n 数字 |
| | | * @return 中文大写数字 |
| | | */ |
| | | public static String digitUppercase(double n) |
| | | { |
| | | String[] fraction = { "角", "分" }; |
| | | String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; |
| | | String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; |
| | | |
| | | String head = n < 0 ? "负" : ""; |
| | | n = Math.abs(n); |
| | | |
| | | String s = ""; |
| | | for (int i = 0; i < fraction.length; i++) |
| | | { |
| | | // 优化double计算精度丢失问题 |
| | | BigDecimal nNum = new BigDecimal(n); |
| | | BigDecimal decimal = new BigDecimal(10); |
| | | BigDecimal scale = nNum.multiply(decimal).setScale(2, RoundingMode.HALF_EVEN); |
| | | double d = scale.doubleValue(); |
| | | s += (digit[(int) (Math.floor(d * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); |
| | | } |
| | | if (s.length() < 1) |
| | | { |
| | | s = "整"; |
| | | } |
| | | int integerPart = (int) Math.floor(n); |
| | | |
| | | for (int i = 0; i < unit[0].length && integerPart > 0; i++) |
| | | { |
| | | String p = ""; |
| | | for (int j = 0; j < unit[1].length && n > 0; j++) |
| | | { |
| | | p = digit[integerPart % 10] + unit[1][j] + p; |
| | | integerPart = integerPart / 10; |
| | | } |
| | | s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; |
| | | } |
| | | return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.text; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 字符串格式化 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class StrFormatter |
| | | { |
| | | public static final String EMPTY_JSON = "{}"; |
| | | public static final char C_BACKSLASH = '\\'; |
| | | public static final char C_DELIM_START = '{'; |
| | | public static final char C_DELIM_END = '}'; |
| | | |
| | | /** |
| | | * 格式化字符串<br> |
| | | * 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
| | | * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
| | | * 例:<br> |
| | | * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
| | | * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
| | | * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
| | | * |
| | | * @param strPattern 字符串模板 |
| | | * @param argArray 参数列表 |
| | | * @return 结果 |
| | | */ |
| | | public static String format(final String strPattern, final Object... argArray) |
| | | { |
| | | if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) |
| | | { |
| | | return strPattern; |
| | | } |
| | | final int strPatternLength = strPattern.length(); |
| | | |
| | | // 初始化定义好的长度以获得更好的性能 |
| | | StringBuilder sbuf = new StringBuilder(strPatternLength + 50); |
| | | |
| | | int handledPosition = 0; |
| | | int delimIndex;// 占位符所在位置 |
| | | for (int argIndex = 0; argIndex < argArray.length; argIndex++) |
| | | { |
| | | delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); |
| | | if (delimIndex == -1) |
| | | { |
| | | if (handledPosition == 0) |
| | | { |
| | | return strPattern; |
| | | } |
| | | else |
| | | { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 |
| | | sbuf.append(strPattern, handledPosition, strPatternLength); |
| | | return sbuf.toString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) |
| | | { |
| | | if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) |
| | | { |
| | | // 转义符之前还有一个转义符,占位符依旧有效 |
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1); |
| | | sbuf.append(Convert.utf8Str(argArray[argIndex])); |
| | | handledPosition = delimIndex + 2; |
| | | } |
| | | else |
| | | { |
| | | // 占位符被转义 |
| | | argIndex--; |
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1); |
| | | sbuf.append(C_DELIM_START); |
| | | handledPosition = delimIndex + 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 正常占位符 |
| | | sbuf.append(strPattern, handledPosition, delimIndex); |
| | | sbuf.append(Convert.utf8Str(argArray[argIndex])); |
| | | handledPosition = delimIndex + 2; |
| | | } |
| | | } |
| | | } |
| | | // 加入最后一个占位符后所有的字符 |
| | | sbuf.append(strPattern, handledPosition, strPattern.length()); |
| | | |
| | | return sbuf.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.easyExcel; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.converters.WriteConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | |
| | | public class BigDecimalConverter implements Converter<BigDecimal> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return String.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | /** |
| | | * 这里读的时候会调用 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BigDecimal convertToJavaData(ReadConverterContext<?> context) { |
| | | try { |
| | | // 检查是否是字符串类型的单元格 |
| | | if (CellDataTypeEnum.STRING.equals(context.getReadCellData().getType())) { |
| | | return new BigDecimal(context.getReadCellData().getStringValue()).setScale(10, RoundingMode.DOWN); |
| | | } |
| | | // 检查是否是数字类型的单元格 |
| | | else if (CellDataTypeEnum.NUMBER.equals(context.getReadCellData().getType())) { |
| | | // 获取数字值并转化为字符串 |
| | | return new BigDecimal(String.valueOf(context.getReadCellData().getNumberValue())).setScale(10, RoundingMode.DOWN); |
| | | } else { |
| | | return null; // 返回null表示未能识别的单元格类型 |
| | | } |
| | | }catch (Exception e){ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里是写的时候会调用 不用管 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(WriteConverterContext<BigDecimal> context) { |
| | | return new WriteCellData<>(String.valueOf(context.getValue())); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | |
| | | package com.ruoyi.common.easyExcel; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.data.ReadCellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | import com.alibaba.excel.util.DateUtils; |
| | | import com.ruoyi.common.exception.GlobalException; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | import java.util.TimeZone; |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | |
| | | public class DateConverter implements Converter<Date> { |
| | | private static final List<String> DEFAULT_DATE_FORMATS = Arrays.asList( |
| | | "yyyy/M/d","dd-M-yyyy", "M/d/yyyy", "yyyy-MM-dd","yyyy-MM", |
| | | "yyyy.MM.dd","yyyy.MM","yyyy","yyyy年MM月dd日","yyyy年MM月","yyyy年" |
| | | ); |
| | | |
| | | @Override |
| | | public Class<Date> supportJavaTypeKey() { |
| | | return Date.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | /** |
| | | * 这里读的时候会调用 |
| | | * |
| | | * @param cellData excel数据 (NotNull) |
| | | * @param contentProperty excel属性 (Nullable) |
| | | * @param globalConfiguration 全局配置 (NotNull) |
| | | * @return 读取到内存中的数据 |
| | | */ |
| | | @Override |
| | | public Date convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | try { |
| | | String stringValue = ""; |
| | | // 1. Excel 单元格是数字类型(如 40969),代表日期 |
| | | if (cellData.getType() == CellDataTypeEnum.NUMBER) { |
| | | //这里有可能是 2025年,是数字类型,也可能是2025.08也是数字,有可能是2025/08/01(这种excel读取是数字类型) |
| | | //2000以后都是5位数 |
| | | if(cellData.getNumberValue().toString().contains(".") |
| | | || cellData.getNumberValue().compareTo(new BigDecimal("2050")) <= 0){ |
| | | stringValue = cellData.getNumberValue().toString(); |
| | | }else { |
| | | double numericDate = cellData.getNumberValue().doubleValue(); |
| | | Date date = DateUtil.getJavaDate(numericDate, false); // HSSF 日期基准是 1900-01-01 |
| | | // System.out.println(cn.hutool.core.date.DateUtil.format(date, "yyyy-MM-dd")); |
| | | return date; |
| | | } |
| | | }else { |
| | | stringValue = cellData.getStringValue(); |
| | | } |
| | | try { |
| | | Date parsedDate = parseDate(stringValue); |
| | | if (parsedDate != null) { |
| | | // System.out.println(cn.hutool.core.date.DateUtil.format(parsedDate, "yyyy-MM-dd")); |
| | | return parsedDate; |
| | | } else { |
| | | throw new ParseException("日期格式不匹配", 0); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ParseException("日期格式不匹配", 0); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new GlobalException("日期格式错误,请保证时间格式为:yyyy/m/d, yyyy-MM-dd, dd-M-yyyy, M/d/yyyy"); |
| | | } |
| | | } |
| | | |
| | | private Date parseDate(String dateStr) throws ParseException { |
| | | for (String defaultFormat : DEFAULT_DATE_FORMATS) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat(defaultFormat, Locale.getDefault()); |
| | | sdf.setTimeZone(TimeZone.getDefault()); |
| | | try { |
| | | return sdf.parse(dateStr); |
| | | } catch (ParseException e) { |
| | | // 继续尝试下一个格式 |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public boolean isValidDate(Date date) { |
| | | if (date == null) { |
| | | return false; |
| | | } |
| | | |
| | | // 定义日期格式 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); |
| | | sdf.setLenient(false); // 关闭宽松模式,严格校验日期 |
| | | |
| | | // 将 Date 转换成字符串,再转换回 Date,确保格式正确 |
| | | String dateStr = sdf.format(date); |
| | | return cn.hutool.core.date.DateUtil.parse(dateStr) == null ? false:true; |
| | | } |
| | | |
| | | /** |
| | | * 写的时候会调用 |
| | | * |
| | | * @param value java value (NotNull) |
| | | * @param contentProperty excel属性 (Nullable) |
| | | * @param globalConfiguration 全局配置 (NotNull) |
| | | * @return 写出到excel文件的数据 |
| | | */ |
| | | @Override |
| | | public WriteCellData<Date> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
| | | DateTimeFormat annotation = contentProperty.getField().getAnnotation(DateTimeFormat.class); |
| | | String format = Objects.nonNull(annotation) ? annotation.pattern() : "yyyy-MM-dd"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault()); |
| | | sdf.setTimeZone(TimeZone.getDefault()); |
| | | String result = sdf.format(value); |
| | | return new WriteCellData<>(result); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.easyExcel; |
| | | |
| | | import com.alibaba.excel.write.handler.AbstractSheetWriteHandler; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | | import org.apache.poi.ss.usermodel.DataValidationConstraint; |
| | | import org.apache.poi.ss.usermodel.DataValidationHelper; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class MultiDropdownWriteHandler extends AbstractSheetWriteHandler { |
| | | |
| | | // 使用 Map 存储列索引和对应的下拉选项 |
| | | private final Map<Integer, String[]> dropdownOptionsMap; |
| | | |
| | | public MultiDropdownWriteHandler(Map<Integer, String[]> dropdownOptionsMap) { |
| | | this.dropdownOptionsMap = dropdownOptionsMap; |
| | | } |
| | | |
| | | @Override |
| | | public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { |
| | | Sheet sheet = writeSheetHolder.getSheet(); |
| | | DataValidationHelper helper = sheet.getDataValidationHelper(); |
| | | |
| | | for (Map.Entry<Integer, String[]> entry : dropdownOptionsMap.entrySet()) { |
| | | int columnIndex = entry.getKey(); |
| | | String[] options = entry.getValue(); |
| | | |
| | | // 定义下拉框应用的单元格范围(这里假设从第1行到第100行) |
| | | // CellRangeAddressList addressList = new CellRangeAddressList(1, 100, columnIndex, columnIndex); |
| | | CellRangeAddressList addressList = new CellRangeAddressList(0, 100, columnIndex, columnIndex); |
| | | |
| | | // 创建下拉选项 |
| | | DataValidationConstraint constraint = helper.createExplicitListConstraint(options); |
| | | DataValidation dataValidation = helper.createValidation(constraint, addressList); |
| | | |
| | | // 设置校验 |
| | | dataValidation.setSuppressDropDownArrow(true); |
| | | dataValidation.setShowErrorBox(true); |
| | | |
| | | // 将校验应用到 sheet |
| | | sheet.addValidationData(dataValidation); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.common.easyExcel; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.converters.WriteConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | |
| | | |
| | | public class NumberConverter implements Converter<Integer> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return String.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | /** |
| | | * 这里读的时候会调用 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer convertToJavaData(ReadConverterContext<?> context) { |
| | | try { |
| | | // 检查是否是字符串类型的单元格 |
| | | if (CellDataTypeEnum.STRING.equals(context.getReadCellData().getType())) { |
| | | return Integer.parseInt(context.getReadCellData().getStringValue()); |
| | | } |
| | | // 检查是否是数字类型的单元格 |
| | | else if (CellDataTypeEnum.NUMBER.equals(context.getReadCellData().getType())) { |
| | | // 获取数字值并转化为字符串 |
| | | return context.getReadCellData().getNumberValue().intValue(); |
| | | } else { |
| | | return null; // 返回null表示未能识别的单元格类型 |
| | | } |
| | | }catch (Exception e){ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里是写的时候会调用 不用管 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) { |
| | | return new WriteCellData<>(String.valueOf(context.getValue())); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.common.easyExcel; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.converters.WriteConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | public class StringConverter implements Converter<String> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return String.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | /** |
| | | * 这里读的时候会调用 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String convertToJavaData(ReadConverterContext<?> context) { |
| | | try { |
| | | String values = ""; |
| | | if (StrUtil.isNotBlank(context.getReadCellData().getStringValue())) { |
| | | values = String.valueOf(context.getReadCellData().getStringValue()); |
| | | } else if (Objects.nonNull(context.getReadCellData().getNumberValue())) { |
| | | BigDecimal test = context.getReadCellData().getNumberValue().setScale(0, BigDecimal.ROUND_DOWN); |
| | | values = test.toString(); |
| | | } |
| | | if (ObjUtil.isEmpty(values)) { |
| | | return ""; |
| | | } |
| | | return values.trim(); |
| | | }catch (Exception e){ |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里是写的时候会调用 不用管 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(WriteConverterContext<String> context) { |
| | | return new WriteCellData<>(String.valueOf(context.getValue())); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 操作状态 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | public enum BusinessStatus |
| | | { |
| | | /** |
| | | * 成功 |
| | | */ |
| | | SUCCESS, |
| | | |
| | | /** |
| | | * 失败 |
| | | */ |
| | | FAIL, |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 业务操作类型 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum BusinessType |
| | | { |
| | | /** |
| | | * 其它 |
| | | */ |
| | | OTHER, |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | INSERT, |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | UPDATE, |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | DELETE, |
| | | |
| | | /** |
| | | * 授权 |
| | | */ |
| | | GRANT, |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | EXPORT, |
| | | |
| | | /** |
| | | * 导入 |
| | | */ |
| | | IMPORT, |
| | | |
| | | /** |
| | | * 强退 |
| | | */ |
| | | FORCE, |
| | | |
| | | /** |
| | | * 生成代码 |
| | | */ |
| | | GENCODE, |
| | | |
| | | /** |
| | | * 清空数据 |
| | | */ |
| | | CLEAN, |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum DataSourceType |
| | | { |
| | | /** |
| | | * 主库 |
| | | */ |
| | | MASTER, |
| | | |
| | | /** |
| | | * 从库 |
| | | */ |
| | | SLAVE |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import java.util.function.Function; |
| | | import com.ruoyi.common.utils.DesensitizedUtil; |
| | | |
| | | /** |
| | | * 脱敏类型 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum DesensitizedType |
| | | { |
| | | /** |
| | | * 姓名,第2位星号替换 |
| | | */ |
| | | USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")), |
| | | |
| | | /** |
| | | * 密码,全部字符都用*代替 |
| | | */ |
| | | PASSWORD(DesensitizedUtil::password), |
| | | |
| | | /** |
| | | * 身份证,中间10位星号替换 |
| | | */ |
| | | ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")), |
| | | |
| | | /** |
| | | * 手机号,中间4位星号替换 |
| | | */ |
| | | PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")), |
| | | |
| | | /** |
| | | * 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换 |
| | | */ |
| | | EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")), |
| | | |
| | | /** |
| | | * 银行卡号,保留最后4位,其他星号替换 |
| | | */ |
| | | BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")), |
| | | |
| | | /** |
| | | * 车牌号码,包含普通车辆、新能源车辆 |
| | | */ |
| | | CAR_LICENSE(DesensitizedUtil::carLicense); |
| | | |
| | | private final Function<String, String> desensitizer; |
| | | |
| | | DesensitizedType(Function<String, String> desensitizer) |
| | | { |
| | | this.desensitizer = desensitizer; |
| | | } |
| | | |
| | | public Function<String, String> desensitizer() |
| | | { |
| | | return desensitizer; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import org.springframework.lang.Nullable; |
| | | |
| | | /** |
| | | * 请求方式 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum HttpMethod |
| | | { |
| | | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; |
| | | |
| | | private static final Map<String, HttpMethod> mappings = new HashMap<>(16); |
| | | |
| | | static |
| | | { |
| | | for (HttpMethod httpMethod : values()) |
| | | { |
| | | mappings.put(httpMethod.name(), httpMethod); |
| | | } |
| | | } |
| | | |
| | | @Nullable |
| | | public static HttpMethod resolve(@Nullable String method) |
| | | { |
| | | return (method != null ? mappings.get(method) : null); |
| | | } |
| | | |
| | | public boolean matches(String method) |
| | | { |
| | | return (this == resolve(method)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 限流类型 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | |
| | | public enum LimitType |
| | | { |
| | | /** |
| | | * 默认策略全局限流 |
| | | */ |
| | | DEFAULT, |
| | | |
| | | /** |
| | | * 根据请求者IP进行限流 |
| | | */ |
| | | IP |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 操作人类别 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum OperatorType |
| | | { |
| | | /** |
| | | * 其它 |
| | | */ |
| | | OTHER, |
| | | |
| | | /** |
| | | * 后台用户 |
| | | */ |
| | | MANAGE, |
| | | |
| | | /** |
| | | * 手机端用户 |
| | | */ |
| | | MOBILE |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | /** |
| | | * 用户状态 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum UserStatus |
| | | { |
| | | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); |
| | | |
| | | private final String code; |
| | | private final String info; |
| | | |
| | | UserStatus(String code, String info) |
| | | { |
| | | this.code = code; |
| | | this.info = info; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() |
| | | { |
| | | return info; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception; |
| | | |
| | | /** |
| | | * 演示模式异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DemoModeException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public DemoModeException() |
| | | { |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception; |
| | | |
| | | /** |
| | | * 全局异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GlobalException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link #getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public GlobalException() |
| | | { |
| | | } |
| | | |
| | | public GlobalException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | public GlobalException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public GlobalException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception; |
| | | |
| | | /** |
| | | * 业务异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public final class ServiceException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public ServiceException() |
| | | { |
| | | } |
| | | |
| | | public ServiceException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public ServiceException(String message, Integer code) |
| | | { |
| | | this.message = message; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public Integer getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public ServiceException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | public ServiceException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception; |
| | | |
| | | /** |
| | | * 工具类异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UtilException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 8247610319171014183L; |
| | | |
| | | public UtilException(Throwable e) |
| | | { |
| | | super(e.getMessage(), e); |
| | | } |
| | | |
| | | public UtilException(String message) |
| | | { |
| | | super(message); |
| | | } |
| | | |
| | | public UtilException(String message, Throwable throwable) |
| | | { |
| | | super(message, throwable); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.base; |
| | | |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 基础异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 所属模块 |
| | | */ |
| | | private String module; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 错误码对应的参数 |
| | | */ |
| | | private Object[] args; |
| | | |
| | | /** |
| | | * 错误消息 |
| | | */ |
| | | private String defaultMessage; |
| | | |
| | | public BaseException(String module, String code, Object[] args, String defaultMessage) |
| | | { |
| | | this.module = module; |
| | | this.code = code; |
| | | this.args = args; |
| | | this.defaultMessage = defaultMessage; |
| | | } |
| | | |
| | | public BaseException(String module, String code, Object[] args) |
| | | { |
| | | this(module, code, args, null); |
| | | } |
| | | |
| | | public BaseException(String module, String defaultMessage) |
| | | { |
| | | this(module, null, null, defaultMessage); |
| | | } |
| | | |
| | | public BaseException(String code, Object[] args) |
| | | { |
| | | this(null, code, args, null); |
| | | } |
| | | |
| | | public BaseException(String defaultMessage) |
| | | { |
| | | this(null, null, null, defaultMessage); |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | String message = null; |
| | | if (!StringUtils.isEmpty(code)) |
| | | { |
| | | message = MessageUtils.message(code, args); |
| | | } |
| | | if (message == null) |
| | | { |
| | | message = defaultMessage; |
| | | } |
| | | return message; |
| | | } |
| | | |
| | | public String getModule() |
| | | { |
| | | return module; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public Object[] getArgs() |
| | | { |
| | | return args; |
| | | } |
| | | |
| | | public String getDefaultMessage() |
| | | { |
| | | return defaultMessage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.file; |
| | | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | |
| | | /** |
| | | * 文件信息异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileException extends BaseException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileException(String code, Object[] args) |
| | | { |
| | | super("file", code, args, null); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.file; |
| | | |
| | | /** |
| | | * 文件名称超长限制异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileNameLengthLimitExceededException extends FileException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileNameLengthLimitExceededException(int defaultFileNameLength) |
| | | { |
| | | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.file; |
| | | |
| | | /** |
| | | * 文件名大小限制异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileSizeLimitExceededException extends FileException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileSizeLimitExceededException(long defaultMaxSize) |
| | | { |
| | | super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.file; |
| | | |
| | | import java.io.PrintStream; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | | * 文件上传异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileUploadException extends Exception |
| | | { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private final Throwable cause; |
| | | |
| | | public FileUploadException() |
| | | { |
| | | this(null, null); |
| | | } |
| | | |
| | | public FileUploadException(final String msg) |
| | | { |
| | | this(msg, null); |
| | | } |
| | | |
| | | public FileUploadException(String msg, Throwable cause) |
| | | { |
| | | super(msg); |
| | | this.cause = cause; |
| | | } |
| | | |
| | | @Override |
| | | public void printStackTrace(PrintStream stream) |
| | | { |
| | | super.printStackTrace(stream); |
| | | if (cause != null) |
| | | { |
| | | stream.println("Caused by:"); |
| | | cause.printStackTrace(stream); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void printStackTrace(PrintWriter writer) |
| | | { |
| | | super.printStackTrace(writer); |
| | | if (cause != null) |
| | | { |
| | | writer.println("Caused by:"); |
| | | cause.printStackTrace(writer); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Throwable getCause() |
| | | { |
| | | return cause; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.file; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 文件上传 误异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class InvalidExtensionException extends FileUploadException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String[] allowedExtension; |
| | | private String extension; |
| | | private String filename; |
| | | |
| | | public InvalidExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super("文件[" + filename + "]后缀[" + extension + "]不正确,请上传" + Arrays.toString(allowedExtension) + "格式"); |
| | | this.allowedExtension = allowedExtension; |
| | | this.extension = extension; |
| | | this.filename = filename; |
| | | } |
| | | |
| | | public String[] getAllowedExtension() |
| | | { |
| | | return allowedExtension; |
| | | } |
| | | |
| | | public String getExtension() |
| | | { |
| | | return extension; |
| | | } |
| | | |
| | | public String getFilename() |
| | | { |
| | | return filename; |
| | | } |
| | | |
| | | public static class InvalidImageExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidFlashExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidMediaExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidVideoExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.job; |
| | | |
| | | /** |
| | | * 计划策略异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TaskException extends Exception |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Code code; |
| | | |
| | | public TaskException(String msg, Code code) |
| | | { |
| | | this(msg, code, null); |
| | | } |
| | | |
| | | public TaskException(String msg, Code code, Exception nestedEx) |
| | | { |
| | | super(msg, nestedEx); |
| | | this.code = code; |
| | | } |
| | | |
| | | public Code getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public enum Code |
| | | { |
| | | TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 黑名单IP异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BlackListException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public BlackListException() |
| | | { |
| | | super("login.blocked", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 验证码错误异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CaptchaException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public CaptchaException() |
| | | { |
| | | super("user.jcaptcha.error", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 验证码失效异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CaptchaExpireException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public CaptchaExpireException() |
| | | { |
| | | super("user.jcaptcha.expire", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | |
| | | /** |
| | | * 用户信息异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserException extends BaseException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserException(String code, Object[] args) |
| | | { |
| | | super("user", code, args, null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 用户不存在异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserNotExistsException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserNotExistsException() |
| | | { |
| | | super("user.not.exists", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 用户密码不正确或不符合规范异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserPasswordNotMatchException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserPasswordNotMatchException() |
| | | { |
| | | super("user.password.not.match", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.exception.user; |
| | | |
| | | /** |
| | | * 用户错误最大次数异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserPasswordRetryLimitExceedException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime) |
| | | { |
| | | super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; |
| | | |
| | | /** |
| | | * 排除JSON敏感属性 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class PropertyPreExcludeFilter extends SimplePropertyPreFilter |
| | | { |
| | | public PropertyPreExcludeFilter() |
| | | { |
| | | } |
| | | |
| | | public PropertyPreExcludeFilter addExcludes(String... filters) |
| | | { |
| | | for (int i = 0; i < filters.length; i++) |
| | | { |
| | | this.getExcludes().add(filters[i]); |
| | | } |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import java.io.IOException; |
| | | import javax.servlet.Filter; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import org.springframework.http.MediaType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * Repeatable 过滤器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RepeatableFilter implements Filter |
| | | { |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException |
| | | { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException |
| | | { |
| | | ServletRequest requestWrapper = null; |
| | | if (request instanceof HttpServletRequest |
| | | && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) |
| | | { |
| | | requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); |
| | | } |
| | | if (null == requestWrapper) |
| | | { |
| | | chain.doFilter(request, response); |
| | | } |
| | | else |
| | | { |
| | | chain.doFilter(requestWrapper, response); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import com.ruoyi.common.utils.http.HttpHelper; |
| | | import com.ruoyi.common.constant.Constants; |
| | | |
| | | /** |
| | | * 构建可重复读取inputStream的request |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper |
| | | { |
| | | private final byte[] body; |
| | | |
| | | public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException |
| | | { |
| | | super(request); |
| | | request.setCharacterEncoding(Constants.UTF8); |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | |
| | | body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8); |
| | | } |
| | | |
| | | @Override |
| | | public BufferedReader getReader() throws IOException |
| | | { |
| | | return new BufferedReader(new InputStreamReader(getInputStream())); |
| | | } |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException |
| | | { |
| | | final ByteArrayInputStream bais = new ByteArrayInputStream(body); |
| | | return new ServletInputStream() |
| | | { |
| | | @Override |
| | | public int read() throws IOException |
| | | { |
| | | return bais.read(); |
| | | } |
| | | |
| | | @Override |
| | | public int available() throws IOException |
| | | { |
| | | return body.length; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isFinished() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) |
| | | { |
| | | |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.Filter; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.enums.HttpMethod; |
| | | |
| | | /** |
| | | * 防止XSS攻击的过滤器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class XssFilter implements Filter |
| | | { |
| | | /** |
| | | * 排除链接 |
| | | */ |
| | | public List<String> excludes = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException |
| | | { |
| | | String tempExcludes = filterConfig.getInitParameter("excludes"); |
| | | if (StringUtils.isNotEmpty(tempExcludes)) |
| | | { |
| | | String[] urls = tempExcludes.split(","); |
| | | for (String url : urls) |
| | | { |
| | | excludes.add(url); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException |
| | | { |
| | | HttpServletRequest req = (HttpServletRequest) request; |
| | | HttpServletResponse resp = (HttpServletResponse) response; |
| | | if (handleExcludeURL(req, resp)) |
| | | { |
| | | chain.doFilter(request, response); |
| | | return; |
| | | } |
| | | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); |
| | | chain.doFilter(xssRequest, response); |
| | | } |
| | | |
| | | private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) |
| | | { |
| | | String url = request.getServletPath(); |
| | | String method = request.getMethod(); |
| | | // GET DELETE 不过滤 |
| | | if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method)) |
| | | { |
| | | return true; |
| | | } |
| | | return StringUtils.matches(url, excludes); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.html.EscapeUtil; |
| | | |
| | | /** |
| | | * XSS过滤处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper |
| | | { |
| | | /** |
| | | * @param request |
| | | */ |
| | | public XssHttpServletRequestWrapper(HttpServletRequest request) |
| | | { |
| | | super(request); |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String name) |
| | | { |
| | | String[] values = super.getParameterValues(name); |
| | | if (values != null) |
| | | { |
| | | int length = values.length; |
| | | String[] escapesValues = new String[length]; |
| | | for (int i = 0; i < length; i++) |
| | | { |
| | | // 防xss攻击和过滤前后空格 |
| | | escapesValues[i] = EscapeUtil.clean(values[i]).trim(); |
| | | } |
| | | return escapesValues; |
| | | } |
| | | return super.getParameterValues(name); |
| | | } |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException |
| | | { |
| | | // 非json类型,直接返回 |
| | | if (!isJsonRequest()) |
| | | { |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | // 为空,直接返回 |
| | | String json = IOUtils.toString(super.getInputStream(), "utf-8"); |
| | | if (StringUtils.isEmpty(json)) |
| | | { |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | // xss过滤 |
| | | json = EscapeUtil.clean(json).trim(); |
| | | byte[] jsonBytes = json.getBytes("utf-8"); |
| | | final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes); |
| | | return new ServletInputStream() |
| | | { |
| | | @Override |
| | | public boolean isFinished() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public int available() throws IOException |
| | | { |
| | | return jsonBytes.length; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) |
| | | { |
| | | } |
| | | |
| | | @Override |
| | | public int read() throws IOException |
| | | { |
| | | return bis.read(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 是否是Json请求 |
| | | * |
| | | * @param request |
| | | */ |
| | | public boolean isJsonRequest() |
| | | { |
| | | String header = super.getHeader(HttpHeaders.CONTENT_TYPE); |
| | | return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | /** |
| | | * 精确的浮点数运算 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Arith |
| | | { |
| | | |
| | | /** 默认除法运算精度 */ |
| | | private static final int DEF_DIV_SCALE = 10; |
| | | |
| | | /** 这个类不能实例化 */ |
| | | private Arith() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的加法运算。 |
| | | * @param v1 被加数 |
| | | * @param v2 加数 |
| | | * @return 两个参数的和 |
| | | */ |
| | | public static double add(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.add(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的减法运算。 |
| | | * @param v1 被减数 |
| | | * @param v2 减数 |
| | | * @return 两个参数的差 |
| | | */ |
| | | public static double sub(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.subtract(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的乘法运算。 |
| | | * @param v1 被乘数 |
| | | * @param v2 乘数 |
| | | * @return 两个参数的积 |
| | | */ |
| | | public static double mul(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.multiply(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 |
| | | * 小数点以后10位,以后的数字四舍五入。 |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2) |
| | | { |
| | | return div(v1, v2, DEF_DIV_SCALE); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 |
| | | * 定精度,以后的数字四舍五入。 |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @param scale 表示表示需要精确到小数点以后几位。 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2, int scale) |
| | | { |
| | | if (scale < 0) |
| | | { |
| | | throw new IllegalArgumentException( |
| | | "The scale must be a positive integer or zero"); |
| | | } |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | if (b1.compareTo(BigDecimal.ZERO) == 0) |
| | | { |
| | | return BigDecimal.ZERO.doubleValue(); |
| | | } |
| | | return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的小数位四舍五入处理。 |
| | | * @param v 需要四舍五入的数字 |
| | | * @param scale 小数点后保留几位 |
| | | * @return 四舍五入后的结果 |
| | | */ |
| | | public static double round(double v, int scale) |
| | | { |
| | | if (scale < 0) |
| | | { |
| | | throw new IllegalArgumentException( |
| | | "The scale must be a positive integer or zero"); |
| | | } |
| | | BigDecimal b = new BigDecimal(Double.toString(v)); |
| | | return b.divide(BigDecimal.ONE, scale, RoundingMode.HALF_UP).doubleValue(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import java.lang.management.ManagementFactory; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.util.Date; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | |
| | | /** |
| | | * 时间工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| | | { |
| | | public static String YYYY = "yyyy"; |
| | | |
| | | public static String YYYY_MM = "yyyy-MM"; |
| | | |
| | | public static String YYYY_MM_DD = "yyyy-MM-dd"; |
| | | |
| | | public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; |
| | | |
| | | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | private static String[] parsePatterns = { |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", |
| | | "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; |
| | | |
| | | /** |
| | | * 获取当前Date型日期 |
| | | * |
| | | * @return Date() 当前日期 |
| | | */ |
| | | public static Date getNowDate() |
| | | { |
| | | return new Date(); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前日期, 默认格式为yyyy-MM-dd |
| | | * |
| | | * @return String |
| | | */ |
| | | public static String getDate() |
| | | { |
| | | return dateTimeNow(YYYY_MM_DD); |
| | | } |
| | | |
| | | public static final String getTime() |
| | | { |
| | | return dateTimeNow(YYYY_MM_DD_HH_MM_SS); |
| | | } |
| | | |
| | | public static final String dateTimeNow() |
| | | { |
| | | return dateTimeNow(YYYYMMDDHHMMSS); |
| | | } |
| | | |
| | | public static final String dateTimeNow(final String format) |
| | | { |
| | | return parseDateToStr(format, new Date()); |
| | | } |
| | | |
| | | public static final String dateTime(final Date date) |
| | | { |
| | | return parseDateToStr(YYYY_MM_DD, date); |
| | | } |
| | | |
| | | public static final String parseDateToStr(final String format, final Date date) |
| | | { |
| | | return new SimpleDateFormat(format).format(date); |
| | | } |
| | | |
| | | public static final Date dateTime(final String format, final String ts) |
| | | { |
| | | try |
| | | { |
| | | return new SimpleDateFormat(format).parse(ts); |
| | | } |
| | | catch (ParseException e) |
| | | { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 日期路径 即年/月/日 如2018/08/08 |
| | | */ |
| | | public static final String datePath() |
| | | { |
| | | Date now = new Date(); |
| | | return DateFormatUtils.format(now, "yyyy/MM/dd"); |
| | | } |
| | | |
| | | /** |
| | | * 日期路径 即年/月/日 如20180808 |
| | | */ |
| | | public static final String dateTime() |
| | | { |
| | | Date now = new Date(); |
| | | return DateFormatUtils.format(now, "yyyyMMdd"); |
| | | } |
| | | |
| | | /** |
| | | * 日期型字符串转化为日期 格式 |
| | | */ |
| | | public static Date parseDate(Object str) |
| | | { |
| | | if (str == null) |
| | | { |
| | | return null; |
| | | } |
| | | try |
| | | { |
| | | return parseDate(str.toString(), parsePatterns); |
| | | } |
| | | catch (ParseException e) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取服务器启动时间 |
| | | */ |
| | | public static Date getServerStartDate() |
| | | { |
| | | long time = ManagementFactory.getRuntimeMXBean().getStartTime(); |
| | | return new Date(time); |
| | | } |
| | | |
| | | /** |
| | | * 计算相差天数 |
| | | */ |
| | | public static int differentDaysByMillisecond(Date date1, Date date2) |
| | | { |
| | | return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); |
| | | } |
| | | |
| | | /** |
| | | * 计算时间差 |
| | | * |
| | | * @param endDate 最后时间 |
| | | * @param startTime 开始时间 |
| | | * @return 时间差(天/小时/分钟) |
| | | */ |
| | | public static String timeDistance(Date endDate, Date startTime) |
| | | { |
| | | long nd = 1000 * 24 * 60 * 60; |
| | | long nh = 1000 * 60 * 60; |
| | | long nm = 1000 * 60; |
| | | // long ns = 1000; |
| | | // 获得两个时间的毫秒时间差异 |
| | | long diff = endDate.getTime() - startTime.getTime(); |
| | | // 计算差多少天 |
| | | long day = diff / nd; |
| | | // 计算差多少小时 |
| | | long hour = diff % nd / nh; |
| | | // 计算差多少分钟 |
| | | long min = diff % nd % nh / nm; |
| | | // 计算差多少秒//输出结果 |
| | | // long sec = diff % nd % nh % nm / ns; |
| | | return day + "天" + hour + "小时" + min + "分钟"; |
| | | } |
| | | |
| | | /** |
| | | * 增加 LocalDateTime ==> Date |
| | | */ |
| | | public static Date toDate(LocalDateTime temporalAccessor) |
| | | { |
| | | ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault()); |
| | | return Date.from(zdt.toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 增加 LocalDate ==> Date |
| | | */ |
| | | public static Date toDate(LocalDate temporalAccessor) |
| | | { |
| | | LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0)); |
| | | ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); |
| | | return Date.from(zdt.toInstant()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | /** |
| | | * 脱敏工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DesensitizedUtil |
| | | { |
| | | /** |
| | | * 密码的全部字符都用*代替,比如:****** |
| | | * |
| | | * @param password 密码 |
| | | * @return 脱敏后的密码 |
| | | */ |
| | | public static String password(String password) |
| | | { |
| | | if (StringUtils.isBlank(password)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return StringUtils.repeat('*', password.length()); |
| | | } |
| | | |
| | | /** |
| | | * 车牌中间用*代替,如果是错误的车牌,不处理 |
| | | * |
| | | * @param carLicense 完整的车牌号 |
| | | * @return 脱敏后的车牌 |
| | | */ |
| | | public static String carLicense(String carLicense) |
| | | { |
| | | if (StringUtils.isBlank(carLicense)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | // 普通车牌 |
| | | if (carLicense.length() == 7) |
| | | { |
| | | carLicense = StringUtils.hide(carLicense, 3, 6); |
| | | } |
| | | else if (carLicense.length() == 8) |
| | | { |
| | | // 新能源车牌 |
| | | carLicense = StringUtils.hide(carLicense, 3, 7); |
| | | } |
| | | return carLicense; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | |
| | | /** |
| | | * 字典工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DictUtils |
| | | { |
| | | /** |
| | | * 分隔符 |
| | | */ |
| | | public static final String SEPARATOR = ","; |
| | | |
| | | /** |
| | | * 设置字典缓存 |
| | | * |
| | | * @param key 参数键 |
| | | * @param dictDatas 字典数据列表 |
| | | */ |
| | | public static void setDictCache(String key, List<SysDictData> dictDatas) |
| | | { |
| | | SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典缓存 |
| | | * |
| | | * @param key 参数键 |
| | | * @return dictDatas 字典数据列表 |
| | | */ |
| | | public static List<SysDictData> getDictCache(String key) |
| | | { |
| | | JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); |
| | | if (StringUtils.isNotNull(arrayCache)) |
| | | { |
| | | return arrayCache.toList(SysDictData.class); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型和字典值获取字典标签 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictValue 字典值 |
| | | * @return 字典标签 |
| | | */ |
| | | public static String getDictLabel(String dictType, String dictValue) |
| | | { |
| | | if (StringUtils.isEmpty(dictValue)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return getDictLabel(dictType, dictValue, SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型和字典标签获取字典值 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictLabel 字典标签 |
| | | * @return 字典值 |
| | | */ |
| | | public static String getDictValue(String dictType, String dictLabel) |
| | | { |
| | | if (StringUtils.isEmpty(dictLabel)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return getDictValue(dictType, dictLabel, SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型和字典值获取字典标签 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictValue 字典值 |
| | | * @param separator 分隔符 |
| | | * @return 字典标签 |
| | | */ |
| | | public static String getDictLabel(String dictType, String dictValue, String separator) |
| | | { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | if (StringUtils.isNull(datas)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | if (StringUtils.containsAny(separator, dictValue)) |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | for (String value : dictValue.split(separator)) |
| | | { |
| | | if (value.equals(dict.getDictValue())) |
| | | { |
| | | propertyString.append(dict.getDictLabel()).append(separator); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | if (dictValue.equals(dict.getDictValue())) |
| | | { |
| | | return dict.getDictLabel(); |
| | | } |
| | | } |
| | | } |
| | | return StringUtils.stripEnd(propertyString.toString(), separator); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型和字典标签获取字典值 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictLabel 字典标签 |
| | | * @param separator 分隔符 |
| | | * @return 字典值 |
| | | */ |
| | | public static String getDictValue(String dictType, String dictLabel, String separator) |
| | | { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | if (StringUtils.isNull(datas)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | if (StringUtils.containsAny(separator, dictLabel)) |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | for (String label : dictLabel.split(separator)) |
| | | { |
| | | if (label.equals(dict.getDictLabel())) |
| | | { |
| | | propertyString.append(dict.getDictValue()).append(separator); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | if (dictLabel.equals(dict.getDictLabel())) |
| | | { |
| | | return dict.getDictValue(); |
| | | } |
| | | } |
| | | } |
| | | return StringUtils.stripEnd(propertyString.toString(), separator); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型获取字典所有值 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典值 |
| | | */ |
| | | public static String getDictValues(String dictType) |
| | | { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | if (StringUtils.isNull(datas)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | for (SysDictData dict : datas) |
| | | { |
| | | propertyString.append(dict.getDictValue()).append(SEPARATOR); |
| | | } |
| | | return StringUtils.stripEnd(propertyString.toString(), SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型获取字典所有标签 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典值 |
| | | */ |
| | | public static String getDictLabels(String dictType) |
| | | { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | if (StringUtils.isNull(datas)) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | for (SysDictData dict : datas) |
| | | { |
| | | propertyString.append(dict.getDictLabel()).append(SEPARATOR); |
| | | } |
| | | return StringUtils.stripEnd(propertyString.toString(), SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * 删除指定字典缓存 |
| | | * |
| | | * @param key 字典键 |
| | | */ |
| | | public static void removeDictCache(String key) |
| | | { |
| | | SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key)); |
| | | } |
| | | |
| | | /** |
| | | * 清空字典缓存 |
| | | */ |
| | | public static void clearDictCache() |
| | | { |
| | | Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*"); |
| | | SpringUtils.getBean(RedisCache.class).deleteObject(keys); |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * @param configKey 参数键 |
| | | * @return 缓存键key |
| | | */ |
| | | public static String getCacheKey(String configKey) |
| | | { |
| | | return CacheConstants.SYS_DICT_KEY + configKey; |
| | | } |
| | | } |
cz-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
cz-common/src/main/java/com/ruoyi/common/utils/LogUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/Threads.java
cz-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java
cz-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
cz-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
cz-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
cz-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java
cz-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
cz-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java
cz-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java
cz-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java
cz-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java
cz-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java
cz-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java
cz-common/src/main/java/com/ruoyi/common/xss/Xss.java
cz-common/src/main/java/com/ruoyi/common/xss/XssValidator.java
cz-framework/pom.xml
cz-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
cz-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
cz-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
cz-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java
cz-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java
cz-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java
cz-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java
cz-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
cz-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java
cz-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
cz-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java
cz-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
cz-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
cz-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java
cz-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java
cz-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
cz-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java
cz-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java
cz-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
cz-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
cz-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java
cz-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
cz-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
cz-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java
cz-system/pom.xml
cz-system/src/main/java/com/ruoyi/system/domain/SysCache.java
cz-system/src/main/java/com/ruoyi/system/domain/SysConfig.java
cz-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java
cz-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
cz-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java
cz-system/src/main/java/com/ruoyi/system/domain/SysPost.java
cz-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java
cz-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java
cz-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java
cz-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java
cz-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
cz-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java
cz-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
cz-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
cz-system/src/main/java/com/ruoyi/system/object/response/index/IndexMessageResponse.java
cz-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java
cz-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
cz-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
cz-system/src/main/resources/mapper/system/SysConfigMapper.xml
cz-system/src/main/resources/mapper/system/SysDeptMapper.xml
cz-system/src/main/resources/mapper/system/SysDictDataMapper.xml
cz-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
cz-system/src/main/resources/mapper/system/SysLogininforMapper.xml
cz-system/src/main/resources/mapper/system/SysMenuMapper.xml
cz-system/src/main/resources/mapper/system/SysNoticeMapper.xml
cz-system/src/main/resources/mapper/system/SysOperLogMapper.xml
cz-system/src/main/resources/mapper/system/SysPostMapper.xml
cz-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml
cz-system/src/main/resources/mapper/system/SysRoleMapper.xml
cz-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
cz-system/src/main/resources/mapper/system/SysUserMapper.xml
cz-system/src/main/resources/mapper/system/SysUserPostMapper.xml
cz-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
pom.xml
sql/chongzhou.sql |