Compare commits

..

No commits in common. 'master' and 'dongdingding' have entirely different histories.

@ -0,0 +1,95 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.8.9</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.8.9-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址http://vue.ruoyi.vip
文档地址http://doc.ruoyi.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/已满-101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/已满-167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](https://img.shields.io/badge/已满-104748341-blue.svg)](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](https://img.shields.io/badge/已满-160110482-blue.svg)](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](https://img.shields.io/badge/已满-170801498-blue.svg)](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](https://img.shields.io/badge/已满-108482800-blue.svg)](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](https://img.shields.io/badge/已满-101046199-blue.svg)](https://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](https://img.shields.io/badge/已满-136919097-blue.svg)](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](https://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](https://img.shields.io/badge/已满-174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [![加入QQ群](https://img.shields.io/badge/已满-161281055-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [![加入QQ群](https://img.shields.io/badge/已满-138988063-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [![加入QQ群](https://img.shields.io/badge/已满-151450850-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [![加入QQ群](https://img.shields.io/badge/已满-224622315-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [![加入QQ群](https://img.shields.io/badge/已满-287842588-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [![加入QQ群](https://img.shields.io/badge/187944233-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) 点击按钮入群。

@ -16,23 +16,13 @@
</description>
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.72</version>
</dependency>
<!-- iText 7 Core 最新版本 -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.2.5</version> <!-- 2023年最新版本 -->
<version>8.0.4</version> <!-- 2023年最新版本 -->
<type>pom</type>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>font-asian</artifactId>
<version>7.1.13</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>html2pdf</artifactId>
@ -46,7 +36,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.23</version>
<version>5.8.37</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
@ -72,22 +62,22 @@
</dependency>
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext-asian -->
<!-- <dependency>-->
<!-- <groupId>com.itextpdf</groupId>-->
<!-- <artifactId>itext-asian</artifactId>-->
<!-- <version>5.2.0</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;富文本转pdfhtml转pdfitext转pdf&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.itextpdf</groupId>-->
<!-- <artifactId>itextpdf</artifactId>-->
<!-- <version>5.5.13</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.itextpdf.tool</groupId>-->
<!-- <artifactId>xmlworker</artifactId>-->
<!-- <version>5.5.13</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<!--富文本转pdfhtml转pdfitext转pdf-->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13</version>
</dependency>
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.5.13</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

@ -39,8 +39,6 @@ public class TimingRemindImpl implements TimingRemindService {
private UserService userService;
@Resource
private SysUserMapper sysUserMapper;
/**
@ -49,18 +47,15 @@ public class TimingRemindImpl implements TimingRemindService {
public void enterpriseTiming(String t, Long id) {
//模拟企业人员数据
//给所有的企业都要添加一条智能提醒数据
List<SysUser> sysUsers = sysUserMapper.selectUserList(new SysUser());
//获取到所有的符合条件的政务用户
List<SysUser> collect = sysUsers.stream().filter(x -> "0".equals(x.getDelFlag()) && "0".equals(x.getStatus()))
.filter(y -> CreditCodeUtil.isCreditCode(y.getUserName()))
.collect(Collectors.toList());
List<String> allEnterprise = new ArrayList<>();
allEnterprise.add("9144030071526726XG");
List<SmartDeclaration> listAdd = new ArrayList<>();
collect.forEach(x -> {
allEnterprise.forEach(x -> {
SmartDeclaration sd = new SmartDeclaration();
sd.setAlertTime(LocalDateTime.parse(t));
sd.setIsRead(1);
sd.setSmartRemindersId(id);
sd.setTyshxydm(x.getUserName());
sd.setTyshxydm(x);
listAdd.add(sd);
});
smartDeclarationService.saveBatch(listAdd);

@ -1,61 +1,44 @@
package com.ruoyi.docking.controller;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.docking.entity.Project;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.docking.entity.request.EditProjectRequest;
import com.ruoyi.docking.entity.request.YdxxtjRequest;
import com.ruoyi.docking.service.ProjectProgressService;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.service.ProjectService;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
* (Project)
*
* @author makejava
* @since 2025-03-25 14:49:04
* @since 2025-03-25 14:47:53
*/
@Api(tags = "项目(对接数据)")
@RestController
@RequestMapping("/gysl/project")
public class ProjectController extends BaseController {
/**
*
*/
@Resource
private ProjectService projectService;
/**
*
*
* @param projectName
* @return
*/
@ApiOperation(value = "查询所有项目数据", response = Project.class)
@GetMapping("/page")
public AjaxResult selectAll(String projectName) {
return success(projectService.page(projectName));
}
/**
*
*/
@ApiOperation(value = "绑定项目")
@PostMapping("/editProject")
public AjaxResult editProject(@RequestBody @Valid EditProjectRequest editProjectRequest) {
return success(projectService.editProject(editProjectRequest));
}
// /**
// * 服务对象
// */
// @Resource
// private ProjectService projectService;
//
// /**
// * 查询所有数据
// * @return 所有数据
// */
// @ApiOperation("查询所有数据")
// @GetMapping("/list")
// @DataSource(value = DataSourceType.SLAVE)
// public AjaxResult selectAll() {
// return success(projectService.list());
// }
}

@ -1,11 +1,11 @@
package com.ruoyi.docking.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.docking.entity.request.YdxxtjRequest;
import com.ruoyi.docking.service.ProjectProgressService;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import io.swagger.annotations.Api;
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
@ -35,15 +36,16 @@ public class ProjectProgressController extends BaseController {
/**
*
*
*
* @param page
* @param zwIdPageReq
* @return
*/
@ApiOperation(value = "查询所有数据", response = ProjectProgress.class)
@ApiOperation(value = "分页查询所有数据", response = ProjectProgress.class)
@GetMapping("/page")
public AjaxResult selectAll(ZwIdPageReq zwIdPageReq) {
return success(projectProgressService.page(zwIdPageReq));
public AjaxResult selectAll(Page<ProjectProgress> page, @Valid ZwIdPageReq zwIdPageReq) {
return success(projectProgressService.page(page, zwIdPageReq));
}
@ -55,10 +57,32 @@ public class ProjectProgressController extends BaseController {
*/
@ApiOperation("新增数据")
@PostMapping("/add")
public AjaxResult insert(@RequestBody @Valid ProjectProgress projectMonthInfo) {
public AjaxResult insert(@RequestBody ProjectProgress projectMonthInfo) {
return success(projectProgressService.save(projectMonthInfo));
}
// /**
// * 测试
// */
// @GetMapping("/test")
// @ApiOperation(value = "测试", response = ProjectProgress.class)
// public AjaxResult test() {
// return success(projectProgressService.djList());
// }
/**
*
*
* @param id
* @return
*/
@GetMapping("/{id}")
@ApiOperation(value = "通过主键查询单条数据", response = ProjectProgress.class)
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(projectProgressService.getById(id));
}
/**
*
@ -69,11 +93,7 @@ public class ProjectProgressController extends BaseController {
@ApiOperation("修改数据")
@PutMapping("/edit")
public AjaxResult update(@RequestBody ProjectProgress projectProgress) {
if (projectProgress.getId() != null) {
return AjaxResult.success(projectProgressService.updateById(projectProgress));
} else {
return AjaxResult.success(projectProgressService.save(projectProgress));
}
return success(projectProgressService.updateById(projectProgress));
}
/**
@ -89,23 +109,14 @@ public class ProjectProgressController extends BaseController {
}
/**
*
*/
@ApiOperation("项目月度信息投资统计")
@GetMapping("/ydxxtj")
public AjaxResult ydxxtj(@Valid YdxxtjRequest projectLegend) {
return success(projectProgressService.ydxxtj(projectLegend));
}
/**
*
*
*/
@ApiOperation(value = "根据条件导出所有月度信息")
@ApiOperation(value = "根据条件导出月度进展详情")
@PostMapping(value = "/export")
public void export(HttpServletResponse response, @Valid ZwIdPageReq zwIdPageReq) throws Exception {
List<ProjectProgress> p1 = projectProgressService.page(zwIdPageReq);
public void export(HttpServletResponse response, ZwIdPageReq zwIdPageReq) throws Exception {
List<ProjectProgress> filteredList = projectProgressService.page(zwIdPageReq);
ExcelUtil<ProjectProgress> util = new ExcelUtil<>(ProjectProgress.class);
util.exportExcel(response, p1, "月度信息");
util.exportExcel(response, filteredList, "月度进展详情");
}
}

@ -4,14 +4,11 @@ package com.ruoyi.docking.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
/**
* (ProjectProgress)
*
@ -21,16 +18,10 @@ import javax.validation.constraints.NotBlank;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("project_progress")
@ApiModel(value="项目月度进度")
@ApiModel(value="项目月度进度",description = "对接数据")
public class ProjectProgress {
@TableId(type = IdType.AUTO)
@ApiModelProperty(value ="项目进度ID" )
private Integer id;
@ApiModelProperty(value ="项目id" )
private Integer xmId;
@ApiModelProperty(value ="项目进度ID" )
private Integer progressId;
@ -40,18 +31,14 @@ public class ProjectProgress {
@ApiModelProperty(value ="月份" )
@Excel(name = "月份")
@NotBlank(message = "请填写月份")
private String month;
@ApiModelProperty(value ="状态" )
@Excel(name = "状态")
private String status;
@ApiModelProperty(value ="本月完成投资" )
@Excel(name = "当月完成投资")
private Float monthDoneAmount;
@ -60,7 +47,6 @@ public class ProjectProgress {
@ApiModelProperty(value ="项目累计完成投资" )
@Excel(name = "累计完成投资")
private Float totalDoneAmount;
@ -138,13 +124,5 @@ public class ProjectProgress {
@ApiModelProperty(value ="下一年税收" )
private Float nextTax;
//---------------
@ApiModelProperty(value ="截止目前累计建成面积(平方米)" )
@Excel(name = "截止目前累计建成面积(平方米)")
private String jzmqjc;
@ApiModelProperty(value ="项目进展详情" )
@Excel(name = "项目进展详情")
private String xmjzxq;
}

@ -1,30 +0,0 @@
package com.ruoyi.docking.entity.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
*
*
* @author du
* @since 2024/7/18 17:14
*/
@Data
public class EditProjectRequest {
/**
* id
*/
@ApiModelProperty("本系统项目id")
@NotNull(message = "本系统项目id不能为空!")
private Long id;
/**
* id
*/
@ApiModelProperty("项目id")
@NotNull(message = "项目id不能为空!")
private Integer projectId;
}

@ -1,28 +0,0 @@
package com.ruoyi.docking.entity.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
*
* @author du
* @since 2025/5/8 10:10
*/
@Data
public class YdxxtjRequest {
@NotNull(message = "年份不能为空!")
@ApiModelProperty("年份")
private String years;
@NotNull(message = "项目id不能为空!")
@ApiModelProperty("项目id")
private Long xmId;
@NotNull(message = "请选择类别!")
@ApiModelProperty("1年度 2季度")
private Integer type;
}

@ -1,35 +1,15 @@
package com.ruoyi.docking.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.entity.Project;
import com.ruoyi.docking.entity.request.EditProjectRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (ProjectProgress)访
* (Project)访
*
* @author makejava
* @since 2025-03-25 14:49:04
* @since 2025-03-25 14:47:57
*/
public interface ProjectMapper extends BaseMapper<Project> {
/**
*
*
* @param name
* @return
*/
@DataSource(value = DataSourceType.SLAVE)
List<Project> page(@Param("name") String name);
/**
*
*/
int editProject(@Param("req") EditProjectRequest editProjectRequest);
}

@ -2,11 +2,8 @@ package com.ruoyi.docking.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -23,17 +20,11 @@ public interface ProjectProgressMapper extends BaseMapper<ProjectProgress> {
/**
*
*
* @param projectId
* @param page
* @param zwIdPageReq
* @return
*/
@DataSource(value = DataSourceType.SLAVE)
List<ProjectProgress> page(@Param("projectId") Long projectId);
/**
* id
*/
List<ProjectProgress> getXmId(@Param("id")Long id);
Page<ProjectProgress> page(Page<ProjectProgress> page,@Param("req") ZwIdPageReq zwIdPageReq);
List<ProjectProgress> page( @Param("req") ZwIdPageReq zwIdPageReq);
}

@ -3,9 +3,7 @@ package com.ruoyi.docking.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.docking.entity.request.YdxxtjRequest;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import javax.validation.Valid;
import java.util.List;
@ -19,16 +17,19 @@ import java.util.List;
public interface ProjectProgressService extends IService<ProjectProgress> {
/**
*
*
*
* @param page
* @param zwIdPageReq
* @return
*/
Page<ProjectProgress> page(Page<ProjectProgress> page, ZwIdPageReq zwIdPageReq);
List<ProjectProgress> page( ZwIdPageReq zwIdPageReq);
/**
*
*
*/
List<YdxxtjResponse> ydxxtj(YdxxtjRequest projectLegend);
List<ProjectProgress> djList();
}

@ -2,29 +2,21 @@ package com.ruoyi.docking.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.docking.entity.Project;
import com.ruoyi.docking.entity.request.EditProjectRequest;
import java.util.List;
/**
* (ProjectProgress)
* (Project)
*
* @author makejava
* @since 2025-03-25 14:49:04
* @since 2025-03-25 14:47:59
*/
public interface ProjectService extends IService<Project> {
/**
*
*
* @param projectName
* @return
*/
List<Project> page( String projectName);
/**
*
*
*/
int editProject(EditProjectRequest editProjectRequest);
List<Project> djList();
}

@ -1,25 +1,18 @@
package com.ruoyi.docking.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.docking.entity.request.YdxxtjRequest;
import com.ruoyi.docking.mapper.ProjectProgressMapper;
import com.ruoyi.docking.service.ProjectProgressService;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import com.ruoyi.gysl.service.BasicInformationService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* (ProjectProgress)
@ -30,110 +23,41 @@ import java.util.stream.Stream;
@Service("projectProgressService")
public class ProjectProgressServiceImpl extends ServiceImpl<ProjectProgressMapper, ProjectProgress> implements ProjectProgressService {
@Resource
private BasicInformationService basicInformationService;
@Resource
private ProjectProgressMapper projectProgressMapper;
@Value("${isZs}")
private Boolean isZs;
/**
*
*
*
* @param page
* @param zwIdPageReq
* @return
*/
@Override
public List<ProjectProgress> page(ZwIdPageReq zwIdPageReq) {
//查询对应的项目基础信息数据
BasicInformation byId = basicInformationService.getById(zwIdPageReq.getXmId());
//获取对接的数据
List<ProjectProgress> page = new ArrayList<>();
if (isZs&&byId.getProjectId()!=null) {
page = projectProgressMapper.page(byId.getProjectId());
public Page<ProjectProgress> page(Page<ProjectProgress> page, ZwIdPageReq zwIdPageReq) {
return baseMapper.page(page, zwIdPageReq);
}
List<ProjectProgress> list = projectProgressMapper.getXmId(byId.getId());
return new ArrayList<>(Stream.concat(list.stream(), page.stream())
.collect(Collectors.toMap(
ProjectProgress::getMonth,
v -> v,
(existing, replacement) -> existing // 冲突时保留现有值即list中的值
))
.values());
@Override
public List<ProjectProgress> page(ZwIdPageReq zwIdPageReq) {
return baseMapper.page(zwIdPageReq);
}
/**
*
*
*/
@DataSource(value = DataSourceType.SLAVE)
@Override
public List<YdxxtjResponse> ydxxtj(YdxxtjRequest zwIdPageReq) {
//查询对应的项目基础信息数据
BasicInformation byId = basicInformationService.getById(zwIdPageReq.getXmId());
//获取对接的数据
List<ProjectProgress> page = new ArrayList<>();
if (isZs&&byId.getProjectId()!=null) {
page = projectProgressMapper.page(byId.getProjectId());
}
List<ProjectProgress> list = projectProgressMapper.getXmId(byId.getId());
List<ProjectProgress> projectProgresses = new ArrayList<>(Stream.concat(list.stream(), page.stream())
.collect(Collectors.toMap(
ProjectProgress::getMonth,
v -> v,
(existing, replacement) -> existing // 冲突时保留现有值即list中的值
))
.values());
List<YdxxtjResponse> res = new ArrayList<>();
if (zwIdPageReq.getType() == 1) {
projectProgresses.forEach(x -> {
if (x.getMonth() != null && x.getMonth().substring(0, 4).equals(zwIdPageReq.getYears())) {
YdxxtjResponse yd = new YdxxtjResponse();
yd.setMonth(x.getMonth());
yd.setYtze(BigDecimal.valueOf(x.getMonthDoneAmount()));
if(byId.getJhtze()==null||x.getMonthDoneAmount()==null){
yd.setYtzbl(new BigDecimal(0));
}else {
yd.setYtzbl(BigDecimal.valueOf(x.getMonthDoneAmount()).divide(byId.getJhtze(), RoundingMode.HALF_UP));
}
yd.setLjtze(BigDecimal.valueOf(x.getTotalDoneAmount()));
res.add(yd);
}
});
return res;
} else if (zwIdPageReq.getType() == 2) {
YdxxtjResponse yd1 = new YdxxtjResponse();
yd1.setJd(1);
yd1.setJdtze(new BigDecimal(0));
YdxxtjResponse yd2 = new YdxxtjResponse();
yd2.setJd(2);
yd2.setJdtze(new BigDecimal(0));
YdxxtjResponse yd3 = new YdxxtjResponse();
yd3.setJd(3);
yd3.setJdtze(new BigDecimal(0));
YdxxtjResponse yd4 = new YdxxtjResponse();
yd4.setJd(4);
yd4.setJdtze(new BigDecimal(0));
res.add(yd1);
res.add(yd2);
res.add(yd3);
res.add(yd4);
projectProgresses.forEach(x -> {
if (x.getMonth() != null && x.getMonth().substring(0, 4).equals(zwIdPageReq.getYears())) {
String monthStr = x.getMonth().substring(5, 7); // 提取 "MM"
// 计算季度1~3月为Q14~6月为Q27~9月为Q310~12月为Q4
int quarter = (Integer.parseInt(monthStr) - 1) / 3 + 1;
for (YdxxtjResponse re : res) {
if (re.getJd() == quarter) {
re.setJdtze(re.getJdtze().add(BigDecimal.valueOf(x.getMonthDoneAmount())));
}
}
}
});
return res;
} else {
throw new ServiceException("查询失败");
}
public List<ProjectProgress> djList() {
//获取当前时间的上一个月的秒级时间戳
// 获取当前时间(带时区)
ZonedDateTime now = ZonedDateTime.now(ZoneId.systemDefault());
// 计算上个月同一时间(自动处理跨月边界)
ZonedDateTime lastMonth = now.minusMonths(1);
// 上个月的时间转换为秒级时间戳
long timestamp = lastMonth.toEpochSecond();
// 当前的时间转换为秒级时间戳
long nowTime = now.toEpochSecond();
return lambdaQuery().ge(ProjectProgress::getCreatedAt, timestamp)
.lt(ProjectProgress::getCreatedAt, nowTime).list();
}
}

@ -1,48 +1,45 @@
package com.ruoyi.docking.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.docking.entity.Project;
import com.ruoyi.docking.entity.request.EditProjectRequest;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.entity.ProjectProgress;
import com.ruoyi.docking.mapper.ProjectMapper;
import com.ruoyi.docking.entity.Project;
import com.ruoyi.docking.service.ProjectService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
/**
* (ProjectProgress)
* (Project)
*
* @author makejava
* @since 2025-03-25 14:49:04
* @since 2025-03-25 14:47:59
*/
@Service("projectService")
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements ProjectService {
@Resource
private ProjectMapper projectMapper;
@Value("${isZs}")
private Boolean isZs;
/**
*
*
* @param projectName
* @return
*/
@Override
public List<Project> page(String projectName) {
return projectMapper.page(projectName);
}
/**
*
*
*/
@DataSource(value = DataSourceType.SLAVE)
@Override
public int editProject(EditProjectRequest editProjectRequest) {
return projectMapper.editProject(editProjectRequest);
public List<Project> djList() {
//获取当前时间的上一个月的秒级时间戳
// 获取当前时间(带时区)
ZonedDateTime now = ZonedDateTime.now(ZoneId.systemDefault());
// 计算上个月同一时间(自动处理跨月边界)
ZonedDateTime lastMonth = now.minusMonths(1);
// 上个月的时间转换为秒级时间戳
long timestamp = lastMonth.toEpochSecond();
// 当前的时间转换为秒级时间戳
long nowTime = now.toEpochSecond();
return lambdaQuery().ge(Project::getCreatedAt, timestamp)
.lt(Project::getCreatedAt, nowTime).list();
}
}

@ -14,7 +14,6 @@ import com.ruoyi.docking.mapper.SmartRemindersMapper;
import com.ruoyi.docking.service.SmartRemindersService;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.service.ISysJobService;
import com.ruoyi.system.mapper.SysUserMapper;
import org.quartz.SchedulerException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -35,8 +34,6 @@ public class SmartRemindersServiceImpl extends ServiceImpl<SmartRemindersMapper,
@Resource
private ISysJobService jobService;
@Resource
private SysUserMapper sysUserMapper;
/**
*
@ -101,15 +98,13 @@ public class SmartRemindersServiceImpl extends ServiceImpl<SmartRemindersMapper,
sysJob.setCronExpression(generateCron(jSmartReminders.getAlertTime()));//生成cron表达式
if (jSmartReminders.getAlertRecipients() == 1) {
//如果是企业的定时提醒(调用这个方法)
sysJob.setInvokeTarget("timingRemind.enterpriseTiming("
+ "'" + jSmartReminders.getAlertTime() + "'" + ","
+ jSmartReminders.getId() + "L" + ")");
sysJob.setInvokeTarget("timingRemind.enterpriseTiming(" + "'" + jSmartReminders.getAlertTime() + "'" + "," + jSmartReminders.getId() + "L" + ")");
} else {
//如果是政务端的定时提醒
sysJob.setInvokeTarget("timingRemind.chiefTiming(" + "'"
+ jSmartReminders.getAlertTime() + "'" + ","
+ jSmartReminders.getId() + "L," + "'"
+ jSmartReminders.getProjectId() + "'"+","+ "'"
+ jSmartReminders.getProjectId() + "'"+"'"
+ jSmartReminders.getAlertContent() + "'" + ")");
}
sysJob.setJobGroup("DEFAULT");

@ -3,8 +3,6 @@ package com.ruoyi.gysl.controller;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.crypto.SmUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -19,10 +17,6 @@ import com.ruoyi.gysl.entity.request.AuditRequest;
import com.ruoyi.gysl.entity.request.BasicInformationPageReq;
import com.ruoyi.gysl.entity.response.BasicInformationResponse;
import com.ruoyi.gysl.entity.response.ProjectExcelInfo;
import com.ruoyi.gysl.login.util.HttpGetDataUtil;
import com.ruoyi.gysl.login.util.SM2Demo;
import com.ruoyi.gysl.login.util.SM4Demo;
import com.ruoyi.gysl.login.util.StringUtil;
import com.ruoyi.gysl.service.*;
import com.ruoyi.system.mapper.SysDictDataMapper;
import io.swagger.annotations.Api;
@ -35,15 +29,16 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
@ -104,117 +99,6 @@ public class BasicInformationController extends BaseController {
@Resource
private ProjectOtherInfoService projectOtherInfoService;
@Value("${isZs}")
private Boolean isZs;
private static final String BOUNDARY = "----WebKitFormBoundary7MA4YWxkTrZu0gW"; // 边界字符串(需唯一)
@Value("${sm2}")
private String sm2;
@Value("${sm4}")
private String sm4;
@Value("${accessId}")
private String accessId;
@Value("${sceneId}")
private String sceneId;
@Resource
private HttpGetDataUtil httpGetDataUtil;
/**
*
*/
@ApiOperation("建筑工程施工许可")
@GetMapping("/getJzgcsgxk")
public AjaxResult getJzgcsgxk() throws Exception {
if (isZs) {
String czztdm = "91320594608197761G";
String contacts = "http://172.21.10.46/api/invoke/323018/jzgcsgxk";
String a1 = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec(accessId.getBytes(),
"ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
String a2 = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec(czztdm.getBytes(),
"ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
String a4 = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec(sceneId.getBytes(),
"ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
//生成sm3签名
String input = "accessId=" + accessId + "&czztdm=" + czztdm + "&sceneId=" + sceneId;
try {
// 1. 构建 URL含签名参数处理特殊符号
String encodedSignature = URLEncoder.encode(SmUtil.sm3(input), "UTF-8")
.replace("+", "%20"); // 确保 + 不被编码为空格
String fullUrl = contacts + "?signature=" + encodedSignature;
// 2. 创建连接
URL url = new URL(fullUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
// 3. 构建请求体(严格对齐 curl -F 格式)
try (DataOutputStream out = new DataOutputStream(conn.getOutputStream())) {
writeFormField(out, "accessId", a1);
writeFormField(out, "czztdm", a2);
writeFormField(out, "sceneId", a4);
// 结束标记
out.writeBytes("--" + BOUNDARY + "--\r\n");
}
// 4. 处理响应
int statusCode = conn.getResponseCode();
StringBuilder response = getResponse(statusCode, conn);
if (statusCode == 200) {
JSONObject jsonObj = JSONObject.parseObject(String.valueOf(response));
// if ("200".equals(jsonObj.getString("code"))) { // 使用 getString 避免类型问题
// 直接获取 data 字段为 JSONObject无需转换 String
JSONObject reqData = jsonObj.getJSONObject("data");
String responseParams = reqData.getString("responseParams");
String s = new String((byte[]) SM2Demo.dexec(
Base64.getDecoder().decode(responseParams), "C1C2C3",
Base64.getDecoder().decode(sm2)),
StandardCharsets.UTF_8);
return AjaxResult.success(StringUtil.getFinalData(s));
}
// }
} catch (Exception y) {
y.printStackTrace();
}
}
return success();
}
/**
*
*/
@ApiOperation("建筑工程竣工验收备案表")
@GetMapping("/getJgysbab")
public AjaxResult getJgysbab() throws Exception {
return success();
}
private static StringBuilder getResponse(int statusCode, HttpURLConnection conn) throws IOException {
StringBuilder response = new StringBuilder();
try (BufferedReader in = new BufferedReader(new InputStreamReader(
(statusCode >= 200 && statusCode < 300) ? conn.getInputStream() : conn.getErrorStream(),
StandardCharsets.UTF_8))) {
String line;
while ((line = in.readLine()) != null) {
response.append(line);
}
}
return response;
}
private static void writeFormField(DataOutputStream out, String name, String value) throws Exception {
out.writeBytes("--" + BOUNDARY + "\r\n");
out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n");
out.writeBytes("Content-Type: text/plain; charset=UTF-8\r\n\r\n");
out.writeBytes(value + "\r\n");
}
/**
*
*
@ -266,7 +150,7 @@ public class BasicInformationController extends BaseController {
/**
*
*/
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@ApiOperation(value = "政务端审核")
@PostMapping("/audit")
public AjaxResult audit(@RequestBody AuditRequest req) {
@ -297,7 +181,7 @@ public class BasicInformationController extends BaseController {
* @param id
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@ApiOperation(value = "通过主键查询单条项目所有数据(政务端)", response = BasicInformationResponse.class)
@GetMapping("/{id}")
public AjaxResult selectOne(@PathVariable Long id) {
@ -388,6 +272,7 @@ public class BasicInformationController extends BaseController {
}
/**
*
*/
@ -488,12 +373,12 @@ public class BasicInformationController extends BaseController {
map.put("issuingTime", a1.getBasicInformation().getIssuingTime() != null ? a1.getBasicInformation().getIssuingTime() : "/");
map.put("jsjd", a1.getBasicInformation().getJsjd() != null ? a1.getBasicInformation().getJsjd() : "/");
map.put("xzfl", a1.getBasicInformation().getXzfl() != null ?
basicInformationService.getDictLabel("xzfl", String.valueOf(a1.getBasicInformation().getXzfl()), sysDictData) : "/");
basicInformationService.getDictLabel("xzfl", String.valueOf(a1.getBasicInformation().getXzfl()),sysDictData) : "/");
map.put("nature", a1.getBasicInformation().getNature() != null ?
basicInformationService.getDictLabel("xmfrdwxz", String.valueOf(a1.getBasicInformation().getNature()), sysDictData) : "/");
basicInformationService.getDictLabel("xmfrdwxz", String.valueOf(a1.getBasicInformation().getNature()),sysDictData) : "/");
map.put("name", a1.getBasicInformation().getName() != null ? a1.getBasicInformation().getName() : "/");
map.put("ssgnq", a1.getBasicInformation().getSsgnq() != null ?
basicInformationService.getDictLabel("ssgnq", String.valueOf(a1.getBasicInformation().getSsgnq()), sysDictData) : "/");
basicInformationService.getDictLabel("ssgnq", String.valueOf(a1.getBasicInformation().getSsgnq()),sysDictData) : "/");
map.put("jsdd", a1.getBasicInformation().getJsdd() != null ? a1.getBasicInformation().getJsdd() : "/");
map.put("xmfrdwxz", a1.getBasicInformation().getXmfrdwxz() != null ? a1.getBasicInformation().getXmfrdwxz() : "/");
map.put("tyshxydm", a1.getBasicInformation().getTyshxydm() != null ? a1.getBasicInformation().getTyshxydm() : "/");
@ -527,7 +412,7 @@ public class BasicInformationController extends BaseController {
map.put("kzczmj", a1.getQyrzInformation().getKzczmj() != null ? a1.getQyrzInformation().getKzczmj() : "/");
map.put("gycfpjzj", a1.getQyrzInformation().getGycfpjzj() != null ? a1.getQyrzInformation().getGycfpjzj() : "/");
try {
String itemsFileName = fatherFile + "/" + a1.getBasicInformation().getName() + ".docx";
String itemsFileName = fatherFile + "/" + a1.getBasicInformation().getName()+".docx";
Path targetPath = Paths.get(itemsFileName);
Files.createDirectories(targetPath.getParent());
// 2. 打开输出流(自动覆盖已有文件)
@ -535,7 +420,7 @@ public class BasicInformationController extends BaseController {
Files.newOutputStream(targetPath,
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING))) {
basicInformationService.generateDocument(map, "xmdtcl.docx", out);
basicInformationService.generateDocument(map,"xmdtcl.docx",out);
}
} catch (Exception e) {
throw new RuntimeException("文件下载失败");

@ -1,9 +1,6 @@
package com.ruoyi.gysl.controller;
import cn.hutool.crypto.SmUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -11,28 +8,16 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.gysl.entity.Cybq;
import com.ruoyi.gysl.entity.request.CybqRequest;
import com.ruoyi.gysl.login.util.SM2Demo;
import com.ruoyi.gysl.login.util.SM4Demo;
import com.ruoyi.gysl.service.CybqService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
/**
@ -51,94 +36,6 @@ public class CybqController extends BaseController {
@Resource
private CybqService cybqService;
@Value("${isZs}")
private Boolean isZs;
private static final String BOUNDARY = "----WebKitFormBoundary7MA4YWxkTrZu0gW"; // 边界字符串(需唯一)
/**
* ()
*/
@ApiOperation("企业经济标签信息(统一社会信用代码)")
@GetMapping("/getCybq")
public AjaxResult getCybq() throws Exception {
if (isZs) {
String contacts = "http://172.21.10.46/api/invoke/323018/qyjjbqxx";
String uscc = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec("91320594067622605M".getBytes(),
"ECB", "PKCS5Padding", "random", "ef5323158e0d43e69442718cd4932116".getBytes(), null));
String pageIndex = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec("1".getBytes(),
"ECB", "PKCS5Padding", "random", "ef5323158e0d43e69442718cd4932116".getBytes(), null));
//生成sm3签名
String input = "pageIndex=1&uscc=91320594067622605M";
try {
// 1. 构建 URL含签名参数处理特殊符号
String encodedSignature = URLEncoder.encode(SmUtil.sm3(input), "UTF-8")
.replace("+", "%20"); // 确保 + 不被编码为空格
String fullUrl = contacts + "?signature=" + encodedSignature;
// 2. 创建连接
URL url = new URL(fullUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
// 3. 构建请求体(严格对齐 curl -F 格式)
try (DataOutputStream out = new DataOutputStream(conn.getOutputStream())) {
// 参数 uscc
writeFormField(out, "uscc", uscc);
// 参数 pageIndex
writeFormField(out, "pageIndex", pageIndex);
// 结束标记
out.writeBytes("--" + BOUNDARY + "--\r\n");
}
// 4. 处理响应
int statusCode = conn.getResponseCode();
StringBuilder response = new StringBuilder();
try (BufferedReader in = new BufferedReader(new InputStreamReader(
(statusCode >= 200 && statusCode < 300) ? conn.getInputStream() : conn.getErrorStream(),
StandardCharsets.UTF_8))) {
String line;
while ((line = in.readLine()) != null) {
response.append(line);
}
}
if (statusCode == 200) {
JSONObject jsonObj = JSONObject.parseObject(String.valueOf(response));
if ("200".equals(jsonObj.getString("code"))) { // 使用 getString 避免类型问题
// 直接获取 data 字段为 JSONObject无需转换 String
JSONObject reqData = jsonObj.getJSONObject("data");
String responseParams = reqData.getString("responseParams"); // 直接获取字符串值
String s = new String((byte[]) SM2Demo.dexec(Base64.getDecoder().decode(responseParams), "C1C2C3", Base64.getDecoder().decode("MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgefIcY79Be48T8ryF9tMOKDFZ4XmeB9JzBSmEZHGmvhKhRANCAAQmjPisOvJfv2r7mpj06FszOkAlJiyVL6OoefMmXmqSANNqyT8ZxnFpnToYgtqjQqX44IG8fXk49eLjKXQSfJ2J")), StandardCharsets.UTF_8);
// 解析解密后的 JSON
JSONObject getAllData = JSONObject.parseObject(s);
// 提取 data 字段为 JSONArray
JSONArray js1 = getAllData.getJSONArray("data");
// 转换为 Java 对象列表
List<Cybq> returnData = new ArrayList<>();
for (int i = 0; i < js1.size(); i++) {
JSONObject item = js1.getJSONObject(i);
Cybq res = item.toJavaObject(Cybq.class);
returnData.add(res);
}
return AjaxResult.success(returnData);
}
}
} catch (Exception y) {
y.printStackTrace();
}
}
return success();
}
private static void writeFormField(DataOutputStream out, String name, String value) throws Exception {
out.writeBytes("--" + BOUNDARY + "\r\n");
out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n");
out.writeBytes("Content-Type: text/plain; charset=UTF-8\r\n\r\n");
out.writeBytes(value + "\r\n");
}
/**
*
*
@ -159,7 +56,7 @@ public class CybqController extends BaseController {
* @return
*/
@GetMapping("/{id}")
@ApiOperation(value = "通过主键查询单条数据", response = Cybq.class)
@ApiOperation(value = "通过主键查询单条数据",response = Cybq.class)
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(cybqService.getById(id));
}
@ -225,7 +122,7 @@ public class CybqController extends BaseController {
*/
@ApiOperation(value = "根据条件导出所有产业标签")
@PostMapping(value = "/export")
public void exportMl(HttpServletResponse response, CybqRequest req) {
public void exportMl(HttpServletResponse response, CybqRequest req){
List<Cybq> filteredList = cybqService.page(req);
ExcelUtil<Cybq> util = new ExcelUtil<>(Cybq.class);
util.exportExcel(response, filteredList, "产业标签");

@ -7,10 +7,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.gysl.entity.Dpclgl;
import com.ruoyi.gysl.entity.request.DpclglPageReq;
import com.ruoyi.gysl.service.DpclglService;
import com.ruoyi.gysl.utils.HtmlToPdfConverter;
import com.ruoyi.web.controller.common.CommonController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -27,7 +27,7 @@ import java.util.List;
@Api(tags = "单片材料管理")
@RestController
@RequestMapping("/gysl/dpclgl")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
//@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class DpclglController extends BaseController {
@ -101,6 +101,17 @@ public class DpclglController extends BaseController {
}
/**
*
*
* @return
*/
@ApiOperation(value = "副编辑器内容生成pdf文件url")
@GetMapping("/unloadPdf")
public AjaxResult unloadPdf(@RequestParam(defaultValue = "文章标题") String htmlArticleTitle, @RequestParam(defaultValue = "文章内容") String htmlContent) throws Exception {
MultipartFile multipartFile = HtmlToPdfConverter.convertHtmlToPdf(htmlArticleTitle, htmlContent);
return AjaxResult.success(commonController.uploadFile(multipartFile));
}
}

@ -8,17 +8,14 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.gysl.entity.Enterprise;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.login.util.HttpGetDataUtil;
import com.ruoyi.gysl.service.EnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@ -35,20 +32,12 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/gysl/enterprise")
public class EnterpriseController extends BaseController {
@Value("${isZs}")
private Boolean isZs;
/**
*
*/
@Resource
private EnterpriseService enterpriseService;
@Resource
private HttpGetDataUtil httpGetDataUtil;
/**
* id
*
@ -113,28 +102,15 @@ public class EnterpriseController extends BaseController {
} else {
List<Enterprise> pl = new ArrayList<>(proList.stream()
.collect(Collectors.toMap(
Enterprise::getTyshxydm, // 以 email 作为键
Enterprise::getCode, // 以 email 作为键
p -> p, // 值保留对象本身
(existing, replacement) -> existing // 保留第一个出现的元素
))
.values());
//=============为将要导入的企业补充信息
pl.forEach(x -> {
try {
if(isZs){
Enterprise enterpriseData = httpGetDataUtil.getEnterpriseData(x.getTyshxydm());
if (enterpriseData != null) {
enterpriseData.setXmId(xmId);
enterpriseService.save(enterpriseData);
}
}else {
pl.forEach(x->{
x.setXmId(xmId);
enterpriseService.save(x);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
});
enterpriseService.saveBatch(proList);
successMsg.append("导入成功");
}
return AjaxResult.success(successMsg);

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.gysl.entity.GyslProjectHandbook;
import com.ruoyi.gysl.entity.request.HandbookRequest;
import com.ruoyi.gysl.service.GyslProjectHandbookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -15,7 +14,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
import static com.ruoyi.common.core.domain.AjaxResult.success;
@ -41,16 +39,14 @@ public class GyslProjectHandbookController {
/**
*
*
* @param g
* @param page
* @param gyslProjectHandbook
* @return
*/
@GetMapping("/page")
@ApiOperation(value = "分页查询所有数据", response = GyslProjectHandbook.class)
public AjaxResult selectAll(HandbookRequest g) {
Page<GyslProjectHandbook> a1 = new Page<>();
a1.setCurrent(g.getCurrent());
a1.setSize(g.getSize());
return success(gyslProjectHandbookService.page(a1,g));
public AjaxResult selectAll(Page<GyslProjectHandbook> page, GyslProjectHandbook gyslProjectHandbook) {
return success(gyslProjectHandbookService.page(page, new QueryWrapper<>(gyslProjectHandbook)));
}
/**
@ -62,7 +58,7 @@ public class GyslProjectHandbookController {
@GetMapping("/{id}")
@ApiOperation(value = "通过主键查询单条数据", response = GyslProjectHandbook.class)
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(gyslProjectHandbookService.getData(id));
return success(gyslProjectHandbookService.getById(id));
}
/**

@ -30,7 +30,7 @@ import java.util.List;
@RestController
@RequestMapping("/gysl/ml")
@Api(tags = "目录管理")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class MlController extends BaseController {
/**
*

@ -25,7 +25,7 @@ import java.util.List;
@Api(tags = "项目评价配置")
@RestController
@RequestMapping("/gysl/pjpz")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class PjpzController extends BaseController {
/**
*

@ -61,7 +61,7 @@ public class PlanInformationController extends BaseController {
* @param planInformation
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PostMapping("/add")
@ApiOperation("新增数据")
public AjaxResult insert(@RequestBody PlanInformation planInformation) {

@ -23,7 +23,7 @@ import javax.annotation.Resource;
@Api(tags = "企业统计")
@RestController
@RequestMapping("/gysl/qyStats")
@PreAuthorize("@ss.hasAnyRoles('company')")
//@PreAuthorize("@ss.hasAnyRoles('company')")
public class QyStatsController extends BaseController {
@Resource
@ -38,14 +38,14 @@ public class QyStatsController extends BaseController {
return success(qyStatsService.allProject(SecurityUtils.getUsername()));
}
// /**
// * 关联项目
// */
// @ApiOperation("关联项目")
// @GetMapping("/relationalProject")
// public AjaxResult relationalProject() {
// return success(qyStatsService.relationalProject(SecurityUtils.getUsername()));
// }
/**
*
*/
@ApiOperation("整体项目情况")
@GetMapping("/relationalProject")
public AjaxResult relationalProject() {
return success(qyStatsService.relationalProject(SecurityUtils.getUsername()));
}
/**
*

@ -56,7 +56,7 @@ public class WysmxInformationController extends BaseController {
* @param wysmxInformation
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PostMapping("/add")
@ApiOperation("新增数据")
public AjaxResult insert(@RequestBody WysmxInformation wysmxInformation) {

@ -29,7 +29,7 @@ import java.util.List;
@Api(tags ="细分产业管理" )
@RestController
@RequestMapping("/gysl/xfcygl")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class XfcyglController extends BaseController {
/**
*

@ -4,20 +4,15 @@ package com.ruoyi.gysl.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.gysl.entity.Xmzsk;
import com.ruoyi.gysl.entity.request.XmzskPageReq;
import com.ruoyi.gysl.service.XmzskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.List;
@ -30,7 +25,7 @@ import java.util.List;
@Api(tags = "项目知识库")
@RestController
@RequestMapping("/gysl/xmzsk")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class XmzskController extends BaseController {
/**
*
@ -97,49 +92,5 @@ public class XmzskController extends BaseController {
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
return success(xmzskService.removeByIds(idList));
}
/**
*
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@ApiOperation("导出项目数据")
@PostMapping("/exportInfo")
public void exportInfo(HttpServletResponse response,XmzskPageReq req) {
List<Xmzsk> pE = xmzskService.page(req);
ExcelUtil<Xmzsk> util = new ExcelUtil<>(Xmzsk.class);
util.exportExcel(response, pE, "项目知识库数据");
}
/**
*
*/
@ApiOperation("导出基本信息模板")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<Xmzsk> util = new ExcelUtil<>(Xmzsk.class);
util.importTemplateExcel(response, "项目知识库数据");
}
/**
*
*/
@ApiOperation(value = "项目知识库信息批量导入")
// @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PostMapping(value = "/import", consumes = "multipart/form-data")
@Transactional(rollbackFor = Exception.class)
public AjaxResult importTemplateProject(@RequestPart("file") MultipartFile file) throws Exception {
ExcelUtil<Xmzsk> util = new ExcelUtil<>(Xmzsk.class);
List<Xmzsk> proList = util.importExcel(file.getInputStream());
StringBuilder successMsg = new StringBuilder();
if (proList == null || proList.isEmpty()) {
throw new ServiceException("项目知识库导入数据不能为空");
} else {
xmzskService.saveBatch(proList);
successMsg.append("导入成功");
}
return AjaxResult.success(successMsg);
}
}

@ -6,14 +6,12 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import com.ruoyi.gysl.service.BasicInformationService;
import com.ruoyi.gysl.service.ZwStatsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -38,7 +36,7 @@ import java.util.Map;
@Api(tags = "政务统计")
@RestController
@RequestMapping("/gysl/zwStats")
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov')")
//@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class ZwStatsController extends BaseController {
@Resource
@ -122,15 +120,6 @@ public class ZwStatsController extends BaseController {
}
/**
*
*/
@ApiOperation("储备项目统计分析")
@GetMapping("/cbxmtj")
public AjaxResult cbxmtj() {
return success(zwStatsService.cbxmtj());
}
/**
*
*/
@ -141,8 +130,6 @@ public class ZwStatsController extends BaseController {
}
/**
*
*/

@ -66,12 +66,6 @@ public class BasicInformation extends BaseModel {
@Excel(name = "施工单位", type = Excel.Type.EXPORT)
private String sgdw;
@ApiModelProperty("目录")
private Integer ml;
@ApiModelProperty("细分产业")
private Integer xfcy;
@ApiModelProperty("设计单位")
@Excel(name = "设计单位", type = Excel.Type.EXPORT)
private String sjdw;
@ -169,9 +163,5 @@ public class BasicInformation extends BaseModel {
@Excel(name = "计划投资额", type = Excel.Type.EXPORT)
private BigDecimal jhtze;
@ApiModelProperty("项目id(对接数据)")
private Long projectId;
}

@ -137,27 +137,6 @@ public class BuildingInformation implements Serializable {
@TableField("sfydzk")
private Integer sfydzk;
/**
*
*/
@Excel(name = "地基基础等级")
@ApiModelProperty(value = "地基基础等级")
private String djjcdj;
/**
*
*/
@Excel(name = "吊车情况")
@ApiModelProperty(value = "吊车情况")
private String dcqk;
/**
*
*/
@Excel(name = "货梯情况")
@ApiModelProperty(value = "货梯情况")
private String htqk;
/**
*
*/

@ -26,67 +26,87 @@ public class Cybq {
private Long id;
private String epguid;
@ApiModelProperty(value ="单位编码" )
private String dwbm;
@ApiModelProperty(value ="企业名称" )
private String epname;
@ApiModelProperty(value ="标签标记场景代码" )
private String cjdm;
@ApiModelProperty(value ="统一社会信用代码" )
private String uscc;
@ApiModelProperty(value ="标签代码" )
private String bqdm;
@ApiModelProperty(value ="组织机构代码" )
private String organcode;
@ApiModelProperty(value ="标签值编码" )
private String bqzbm;
@ApiModelProperty(value ="标签值" )
private String codevalue;
@ApiModelProperty(value ="引用代码集编码" )
private String yydmjbm;
@ApiModelProperty(value ="标签名称" )
private String labelname;
@ApiModelProperty(value ="引用代码集版本" )
private String yydmjbb;
@ApiModelProperty(value ="标签代码" )
private String catalogueid;
@ApiModelProperty(value ="有效状态" )
private String state;
@ApiModelProperty(value ="标签值编码" )
private String codekey;
@ApiModelProperty(value ="标签注释" )
private String bqzs;
@ApiModelProperty(value ="引用代码集编码" )
private String cscode;
@ApiModelProperty(value ="用户类型" )
private String yhlx;
@ApiModelProperty(value ="引用代码集版本" )
private String csversion;
@ApiModelProperty(value ="标签标记用户" )
private String bqbjyh;
@ApiModelProperty(value ="标签注释" )
private String lablenotes;
@ApiModelProperty(value ="标签标记单位" )
private String bqbjdw;
@ApiModelProperty(value ="标签状态" )
private String status;
private String bqzt;
@ApiModelProperty(value ="更新时间" )
private String regtime;
@ApiModelProperty(value ="数据来源编码" )
private String sjlybm;
@ApiModelProperty(value ="数据来源名称" )
private String dw_timestamp;
private String sjlymc;
@ApiModelProperty(value ="标签标记场景代码" )
private String sceneid;
@ApiModelProperty(value ="数据溯源码" )
private String sjsym;
@ApiModelProperty(value ="标签状态" )
private String labelmark;
@ApiModelProperty(value ="记录状态" )
private String jlzt;
@ApiModelProperty(value ="数据记录备注" )
private String sjjzbz;
@ApiModelProperty(value ="数据创建用户" )
private String sjcjyh;
@ApiModelProperty(value ="数据创建时间" )
private String sjcjsj;
@ApiModelProperty(value ="数据修改用户" )
private String sjxgyh;
@ApiModelProperty(value ="数据修改时间" )
private String sjxgsj;
}

@ -1,299 +1,77 @@
package com.ruoyi.gysl.entity;
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 com.ruoyi.common.annotation.Excel;
import com.ruoyi.gysl.entity.baseModel.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* bms_enterprise_basic_info
* (Enterprise)
*
* @author farben
* @date 2023-08-25
* @author makejava
* @since 2025-02-24 11:26:49
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gysl_enterprise")
@ApiModel(value = "Enterprise", description = "入驻企业基本信息")
public class Enterprise extends BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(value = "主键id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* id
*/
@ApiModelProperty("项目id")
@ApiModelProperty(value = "项目id")
@TableField("xm_id")
private Long xmId;
/**
*
*/
@ApiModelProperty("源主键")
private String ywid;
/**
* org
*/
@ApiModelProperty("源表org")
private String org;
/**
*
*/
@ApiModelProperty("企业名称")
@Excel(name = "企业名称*",required = true)
private String qymc;
/**
*
*/
@ApiModelProperty("标识证号")
private String bszh;
@ApiModelProperty(value = "企业名称")
@TableField("name")
@Excel(name = "企业名称")
private String name;
/**
*
*/
@ApiModelProperty("统一社会信用代码")
@Excel(name = "统一社会信用代码*",required = true)
private String tyshxydm;
/**
*
*/
@ApiModelProperty("企业注册号")
private String qyzch;
/**
*
*/
@ApiModelProperty("组织机构代码")
private String zzjgdm;
/**
*
*/
@ApiModelProperty("经济类型代码")
private String jjlxdm;
/**
*
*/
@ApiModelProperty("经济类型名称")
private String jjlxmc;
/**
*
*/
@ApiModelProperty("企业类型代码")
private String qylxdm;
/**
*
*/
@ApiModelProperty("企业类型名称")
private String qylxmc;
/**
*
*/
@ApiModelProperty("注册资金")
private String zczj;
/**
*
*/
@ApiModelProperty("注册资本币种")
private String zczbbz;
/**
*
*/
@ApiModelProperty("注册类型")
private String zclx;
/**
*
*/
@ApiModelProperty("经营范围")
private String jyfw;
/**
*
*/
@ApiModelProperty("经营或营业起始日期")
private String jyhyyqsrq;
/**
*
*/
@ApiModelProperty("经营或营业截止日期")
private String jyhyyjzrq;
/**
*
*/
@ApiModelProperty("行业代码")
private String hydm;
/**
*
*/
@ApiModelProperty("行业名称")
private String hymc;
/**
*
*/
@ApiModelProperty("行业门类")
private String hyml;
/**
*
*/
@ApiModelProperty("产业类型")
private String cylx;
/**
*
*/
@ApiModelProperty("企业住所")
private String qyzs;
/**
*
*/
@ApiModelProperty("经营场所")
private String jycs;
/**
*
*/
@ApiModelProperty("经营场所行政区划")
private String jycsxzqh;
/**
*
*/
@ApiModelProperty("邮政编码")
private String yzbm;
/**
*
*/
@ApiModelProperty("成立日期")
private String clrq;
/**
*
*/
@ApiModelProperty("信用等级")
private String xydj;
/**
*
*/
@ApiModelProperty("企业规模")
private String qygm;
/**
*
*/
@ApiModelProperty("法定代表人姓名")
private String fddbrxm;
/**
*
*/
@ApiModelProperty("法定代表人证件号码")
private String fddbrzjhm;
/**
*
*/
@ApiModelProperty("登记机关")
private String djjg;
/**
*
*/
@ApiModelProperty("核准日期")
private String hzrq;
/**
*
*/
@ApiModelProperty("经营状态")
private String jyzt;
/**
*
*/
@ApiModelProperty("状态日期")
private String ztrq;
/**
*
*/
@ApiModelProperty("注销日期")
private String zxrq;
/**
*
*/
@ApiModelProperty("吊销日期")
private String dxrq;
/**
*
*/
@ApiModelProperty("联系电话")
private String lxdh;
/**
*
*/
@ApiModelProperty("是否园区内")
private String sfyqn;
/**
*
*/
@ApiModelProperty("操作标识")
private String dwOperation;
/**
*
*/
@ApiModelProperty("入库时间")
private String dwTimestamp;
/**
*
*/
@ApiModelProperty("代理键")
private String dwAgencykey;
@ApiModelProperty(value = "统一社会信用代码")
@TableField("code")
@Excel(name = "统一社会信用代码")
private String code;
/**
*
*
*/
@ApiModelProperty("来源机构")
private String dwLyjg;
@ApiModelProperty(value = "所属行业 ")
@TableField("sshy")
@Excel(name = "所属行业")
private String sshy;
/**
*
*
*/
@ApiModelProperty("来源表名")
private String dwLyb;
@ApiModelProperty(value = "租金价格")
@TableField("zjjg")
@Excel(name = "租金价格")
private Integer zjjg;
}

@ -2,7 +2,6 @@ package com.ruoyi.gysl.entity;
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.ruoyi.gysl.entity.baseModel.BaseModel;
@ -12,7 +11,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* (GyslProjectHandbook)
@ -33,33 +31,28 @@ public class GyslProjectHandbook extends BaseModel {
@NotBlank(message = "手册名称不能为空!")
private String name;
@ApiModelProperty(value ="副标题1" )
private String subtitle1;
@ApiModelProperty(value ="副标题" )
@NotBlank(message = "副标题不能为空!")
private String subtitle;
@ApiModelProperty(value ="封面图片" )
@NotBlank(message = "封面图片不能为空!")
private String coverImg;
@ApiModelProperty(value ="副标题2" )
private String subtitle2;
@ApiModelProperty(value ="项目id" )
@NotBlank(message = "请选择项目id!")
private String xmId;
@ApiModelProperty(value ="单位名称" )
private String dwname;
@ApiModelProperty(value ="联系人" )
private String lxname;
@ApiModelProperty(value ="手机号" )
private String phone;
@ApiModelProperty(value ="日期" )
private String date;
@ApiModelProperty(value ="封尾图片" )
@NotBlank(message = "封尾图片不能为空!")
private String tailingImg;
@ApiModelProperty(value ="地址" )
private String address;
@ApiModelProperty(value ="项目名称数组" )
@TableField(exist = false)
private List<BasicInformation> projectName;
@ApiModelProperty(value ="封尾标题" )
@NotBlank(message = "封尾图片不能为空!")
private String tail;
}

@ -7,7 +7,6 @@ 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.ruoyi.common.annotation.Excel;
import com.ruoyi.gysl.entity.baseModel.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -39,14 +38,12 @@ public class Xmzsk extends BaseModel implements Serializable {
*/
@ApiModelProperty(value = "文件名称")
@TableField("name")
@Excel(name = "文件名称")
private String name;
/**
*
*/
@ApiModelProperty(value = "类型")
@Excel(name = "类型")
@TableField("lx")
private String lx;
@ -54,7 +51,6 @@ public class Xmzsk extends BaseModel implements Serializable {
*
*/
@ApiModelProperty(value = "网址")
@Excel(name = "网址")
@TableField("wz")
private String wz;
@ -70,7 +66,6 @@ public class Xmzsk extends BaseModel implements Serializable {
*/
@ApiModelProperty(value = "上传用户")
@TableField("scyh")
@Excel(name = "上传用户")
private String scyh;
/**
@ -78,7 +73,6 @@ public class Xmzsk extends BaseModel implements Serializable {
*/
@ApiModelProperty(value = "上传时间")
@TableField("scsj")
@Excel(name = "上传时间")
private Date scsj;
}

@ -38,7 +38,4 @@ public class BasicInformationPageReq {
@ApiModelProperty("0非负面清单 1是负面清单")
private Integer isFmqd;
@ApiModelProperty("状态")
private Integer status;
}

@ -12,9 +12,12 @@ import lombok.Data;
public class CybqRequest {
@ApiModelProperty(value ="标签代码" )
private String catalogueid;
private String bqdm;
@ApiModelProperty(value ="标签状态" )
private String status;
private String bqzt;
@ApiModelProperty(value ="用户类型" )
private String yhlx;
}

@ -1,37 +0,0 @@
package com.ruoyi.gysl.entity.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2025/4/17 17:18
*/
@Data
public class HandbookRequest {
@ApiModelProperty(value ="手册名称" )
private String name;
@ApiModelProperty(value = "开始时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
@ApiModelProperty(value = "结束时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
@ApiModelProperty(value = "页数")
private Integer current = 1;
@ApiModelProperty(value = "页码s")
private Integer size = 10;
}

@ -1,52 +0,0 @@
package com.ruoyi.gysl.entity.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2025/5/21 2:30
*/
@Data
public class JgysbabResponse {
@ApiModelProperty(value ="证照颁发日期" )
private String ZZBFRQ;
@ApiModelProperty(value ="证照颁发机构" )
private String ZZBFJG;
@ApiModelProperty(value ="证照有效期截至日期" )
private String ZZYXQJZRQ;
@ApiModelProperty(value ="持证主体代码类型代码" )
private String CZZTDMLXDM;
@ApiModelProperty(value ="持证主体代码" )
private String CZZTDM;
@ApiModelProperty(value ="证照编号" )
private String ZZBH;
@ApiModelProperty(value ="持证主体" )
private String CZZT;
@ApiModelProperty(value ="证照文件流" )
private String pdfBase64;
@ApiModelProperty(value ="持证主体代码类型" )
private String CZZTDMLX;
@ApiModelProperty(value ="证照有效期起始日期" )
private String ZZYXQQSRQ;
@ApiModelProperty(value ="证照标识" )
private String ZZBS;
@ApiModelProperty(value ="证照名称" )
private String ZZMC;
@ApiModelProperty(value ="证照颁发机构代码" )
private String ZZBFJGDM;
}

@ -1,33 +0,0 @@
package com.ruoyi.gysl.entity.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
*
* @author du
* @since 2025/5/8 9:34
*/
@Data
public class YdxxtjResponse {
@ApiModelProperty("月度")
private String month;
@ApiModelProperty("季度")
private Integer jd;
@ApiModelProperty("季度投资额")
private BigDecimal jdtze;
@ApiModelProperty("月投资额")
private BigDecimal ytze;
@ApiModelProperty("月投资比例")
private BigDecimal ytzbl;
@ApiModelProperty("累计投资额")
private BigDecimal ljtze;
}

@ -29,15 +29,6 @@ public class AllProjectResponse {
@ApiModelProperty("拟建数量")
private Integer allBuilding3;
@ApiModelProperty("总投资额")
private BigDecimal allInvest1;
@ApiModelProperty("计划投资额")
private BigDecimal allInvest2;
@ApiModelProperty("占地面积")
private BigDecimal allInvest3;
@ApiModelProperty("当年_新开工项目数")
private Integer currentYearProject;
@ -53,13 +44,4 @@ public class AllProjectResponse {
@ApiModelProperty("当年_拟建数量")
private Integer currentBuilding3;
@ApiModelProperty("总投资额")
private BigDecimal currentAllInvest1;
@ApiModelProperty("计划投资额")
private BigDecimal currentAllInvest2;
@ApiModelProperty("占地面积")
private BigDecimal currentAllInvest3;
}

@ -12,7 +12,7 @@ import lombok.Data;
@Data
public class RibbonResponse {
@ApiModelProperty("所属功能区 / 单位性质 / 细分产业 / 建设模式")
@ApiModelProperty("所属功能区 / 单位性质 / 细分产业")
private String ssgnq;
@ApiModelProperty("数量")

@ -1,130 +0,0 @@
package com.ruoyi.gysl.login.controller;
import cn.hutool.core.codec.Base64;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.gysl.login.dto.request.UserInfoRequestDTO;
import com.ruoyi.gysl.login.dto.response.ChiefResponse;
import com.ruoyi.gysl.login.dto.response.ThirdUserInfoResponse;
import com.ruoyi.gysl.login.service.LoginTokenService;
import com.ruoyi.gysl.login.util.HMAC256Config;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.HashMap;
/**
*
*
* @author du
* @since 2024/6/4 9:53
*/
@Api(tags = "政务端单点登录")
@RequestMapping("/system/chief")
@RestController
public class ChiefController {
@Value("${clientId}")
private String clientId;
@Value("${clientSecret}")
private String clientSecret;
@Value("${appkey}")
private String appkey;
@Value("${getInfoId}")
private String getInfoId;
@Value("${getAllInfo}")
private String getAllInfo;
@Resource
private LoginTokenService loginTokenService;
@ApiOperation("政务端登录")
@GetMapping
public AjaxResult login(
@RequestParam("userToken") String userToken,
@RequestParam("timespan") String timespan,
@RequestParam("signature") String signature
) throws Exception {
String encode = Base64.encode((HMAC256Config.HmacSHA256(clientId + timespan + userToken, clientSecret)));
if (encode.equals(signature)) {
//经济大脑(政务端)获取用户信息接口
UserInfoRequestDTO req = new UserInfoRequestDTO();
req.setClientId(clientId);
req.setUserToken(userToken);
//请求头
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
headers.put("signature", Base64.encode(HMAC256Config.HmacSHA256(JSONUtil.parse(req).toString() + timespan, clientSecret)));
headers.put("timespan", timespan);
//请求体
JSONObject jsonObject = new JSONObject();//存放参数
jsonObject.set("clientId", clientId);
jsonObject.set("userToken", userToken);
HttpResponse response = HttpRequest.post(getInfoId)
.addHeaders(headers)
.body(jsonObject.toString())
.execute();
// 获取响应状态码
if (response.getStatus() == 200) {
//经济大脑(政务端)获取用户信息接口
JSONObject jsonObj = JSONUtil.parseObj(response.body());
ThirdUserInfoResponse res = JSONUtil.toBean(jsonObj.get("data").toString(), ThirdUserInfoResponse.class);
//政务通获取用户信息接口(可选)
String getInfo = getAllInfo + "?id=" + res.getUserId() + "&appkey=" + appkey;
HttpResponse getMain = HttpRequest.get(getInfo).execute();
if (getMain.getStatus() == 200) {
JSONObject dataJson = JSONUtil.parseObj(getMain.body());
ChiefResponse bean = JSONUtil.toBean(dataJson, ChiefResponse.class);
//判断几个政务端用户,等待商量结果
bean.setToken(loginTokenService.singleLogin(bean.getAccountName(),
bean.getName(),
"01", bean.getMobile(),bean.getEmail()));
return AjaxResult.success(bean);
} else {
throw new ServiceException("登陆失败");
}
}
} else {
throw new ServiceException("登陆失败");
}
throw new ServiceException("登陆失败");
}
// @ApiOperation("政务根据信用代码返回跳转路由")
// @GetMapping("/returnUrl")
// public AjaxResult returnUrl(@RequestParam("code") String code,
// @RequestParam("userToken") String userToken) throws Exception {
// //请求的地址
// StringBuilder url = new StringBuilder("http://172.21.10.12/sipsg-enterprise-mobile-manage/#/loginVerify?");
// //当前时间的时间戳
// String timespan = Long.toString(System.currentTimeMillis());
// UserInfoRequestDTO req = new UserInfoRequestDTO();
// req.setClientId(clientId);
// req.setUserToken(userToken);
// String signature = Base64.encode(HMAC256Config.HmacSHA256(JSONUtil.parse(req).toString() + timespan, clientSecret));
// url.append("signature=").append(signature);
// url.append("&timespan=").append(timespan);
// url.append("&userToken=").append(userToken);
// url.append("&gourl=")
// .append(URLEncoder.encode("https://172.21.10.12/sipsg-enterprise-mobile-manage/#/workPlat/search/enterprise/detail?id="+code,"UTF-8"));
// url.append("&clientid=").append(clientId);
// return AjaxResult.success(url.toString());
// }
}

@ -1,179 +0,0 @@
package com.ruoyi.gysl.login.controller;
/**
* @author dong
* @since 2024/5/22 15:50
*/
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.login.dto.response.UserMainResponse;
import com.ruoyi.gysl.login.dto.response.UserResponse;
import com.ruoyi.gysl.login.service.LoginTokenService;
import com.ruoyi.gysl.service.BasicInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
@Api(tags = "企业端单点登陆")
@RestController
@RequestMapping("/system/singlelogin")
public class SingleLoginController {
@Value("${url}")
private String url;
@Value("${infoUrl}")
private String infoUrl;
@Value("${logoutUrl}")
private String logoutUrl;
@Value("${returnUrl}")
private String returnUrl;
@Resource
private LoginTokenService loginTokenService;
@Value("${enterpriseAppId}")
private String enterpriseAppId;
@Value("${enterpriseAppsecret}")
private String enterpriseAppsecret;
@Resource
private BasicInformationService basicInformationService;
/**
*
*/
@ApiOperation("统一登陆")
@GetMapping("/login")
public void login(HttpServletResponse response) throws IOException {
//变成参数模式,appid 用于校验提交的来源地址,生产环境会校验,试用环境暂不校验
String scUrl = "clientUrl=" + URLEncoder.encode(returnUrl, "UTF-8") + "&appid=" + enterpriseAppId;
//加密后的客户端地址
scUrl = Base64.getEncoder().encodeToString(scUrl.getBytes());
//最终跳转地址
String jumpurl = url + "?scUrl=" + URLEncoder.encode(scUrl, "UTF-8");
// 添加请求头
response.setHeader("Content-Type", "application/json");
response.setHeader("X-Requested-With", "XMLHttpRequest");
response.sendRedirect(jumpurl);
}
/**
*
*
* @return
*/
@ApiOperation(value = "获取用户信息", response = UserResponse.class)
@GetMapping("/getInfo")
public AjaxResult getInfo(String clientToken) throws Exception {
HttpResponse response = HttpRequest.get(infoUrl)
.form("clienttoken", clientToken)
.addHeaders(generationHeader())
.execute();
System.out.println(response.body());
String responseBody;
int statusCode = response.getStatus();
if (statusCode == 200) {
// 获取响应内容
responseBody = response.body();
JSONObject jsonObj = JSONUtil.parseObj(responseBody);
JSONObject dataObj = jsonObj.getJSONObject("data");
//判断是法人用户
if ("ep".equals(dataObj.get("usertype"))) {
JSONObject mainobj = dataObj.getJSONObject("mainbody");
UserResponse res = JSONUtil.toBean(dataObj, UserResponse.class);
UserMainResponse req = JSONUtil.toBean(mainobj, UserMainResponse.class);
Long count = basicInformationService.lambdaQuery()
.eq(BasicInformation::getTyshxydm, req.getUscc())
.or()
.eq(BasicInformation::getXmfrdwxz, req.getEpname()).count();
if (count > 0) {
String token = loginTokenService.singleLogin(req.getUscc(), req.getEpname(),
"02", null, null);
res.setToken(token);
res.setMain(req);
return AjaxResult.success(res);
}else {
throw new ServiceException("贵公司无需参与苏州工业园区工业上楼相关填报工作。系统将即刻为您返回企业服务一张网界面,以便您处理其他业务事宜!");
}
} else {
throw new ServiceException("该用户不是企业法人");
}
} else {
throw new ServiceException("未知异常请联系管理员");
}
}
/**
* 退
*
* @param clienttoken clienttoken
* @return
*/
@ApiOperation(value = "退出登录")
@GetMapping("/enterpriseLogout")
public AjaxResult enterpriseLogout(@RequestParam("clienttoken") String clienttoken) {
String url = logoutUrl + "?clienttoken=" + clienttoken;
HttpResponse execute = HttpUtil.createGet(url)
.addHeaders(generationHeader())
.execute();
String str;
// 获取响应状态码
int statusCode = execute.getStatus();
if (statusCode == 200) {
str = "退出成功";
} else {
str = "退出失败";
}
return AjaxResult.success(str);
}
/**
*
*
* @return
*/
private Map<String, String> generationHeader() {
// 定义时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String format = LocalDateTime.now().format(formatter);
//正式端需要请求头
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
headers.put("appid", enterpriseAppId);
headers.put("time", format);
headers.put("sign", DigestUtil.md5Hex(enterpriseAppId + enterpriseAppsecret + format));
return headers;
}
}

@ -1,15 +0,0 @@
package com.ruoyi.gysl.login.dto.request;
import lombok.Data;
/**
*
*
* @author du
* @since 2024/6/20 11:20
*/
@Data
public class UserInfoRequestDTO {
private String clientId;
private String userToken;
}

@ -1,47 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*
* @author du
* @since 2024/6/4 11:05
*/
@Data
@ApiModel("政务端用户")
public class ChiefResponse {
@ApiModelProperty("本系统token")
private String token;
private String id;
private String mainTopOrganizationId;
private String isEnabled;
private String isOfficial;
private String isUseOA;
private String name;
private String familyName;
private String givenName;
private String accountName;
private String email;
private String mobile;
private String sex;
private String idNumber;
private String birthday;
private String workPhone;
private String shortPhone;
private String workAddress;
private String state;
private String description;
// private String post;
private String secondaryEmail;
private String hasDomainAccount;
private SettingsResponse settings;
private List<OrganizationsResponse> organizations;
private String whenCreated;
private String whenUpdated;
}

@ -1,27 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* organizations
*
* @author du
* @since 2024/6/4 14:42
*/
@Data
@ApiModel("organizations其他响应类")
public class OrganizationsOtherResponse {
private String id;
private String parentId;
private String name;
private String path;
private String displayName;
private String description;
private String order;
private String whenCreated;
private String whenUpdated;
private String type;
private SettingsResponse settings;
}

@ -1,22 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* organizations
*
* @author du
* @since 2024/6/4 14:40
*/
@Data
@ApiModel("organizations响应类")
public class OrganizationsResponse {
private String userId;
private String isPrimary;
private String organizationId;
private String userOrder;
private String organizationOrder;
private String user;
private OrganizationsOtherResponse organization;
}

@ -1,19 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* settings
*
* @author du
* @since 2024/6/4 11:07
*/
@Data
@ApiModel("settings响应类")
public class SettingsResponse {
private String isContactsHidden;
private String isContactsHiddenMobile;
private String isContactsHiddenBirthday;
private String isContactsHiddenWorkPhone;
}

@ -1,18 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import lombok.Data;
/**
*
*
* @author du
* @since 2024/6/20 13:38
*/
@Data
public class ThirdUserInfoResponse {
private String userId;
private String name;
private String userType;
}

@ -1,35 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2024/5/27 14:37
*/
@Data
@ApiModel("法人用户机构代码")
public class UserMainResponse {
/**
*
*/
@ApiModelProperty(value = "对应企业的组织机构代码")
private String organcode;
/**
*
*/
@ApiModelProperty(value = "对应企业的统一社会信用代码")
private String uscc;
/**
*
*/
@ApiModelProperty(value = "对应企业名称")
private String epname;
}

@ -1,71 +0,0 @@
package com.ruoyi.gysl.login.dto.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
*
*
* @author dong
* @since 2024/5/27 10:55
*/
@ApiModel(value = "法人用户")
@Data
public class UserResponse implements Serializable {
private static final long serialVersionUID = -5117946174934452302L;
/**
*
*/
@ApiModelProperty(value = "登录账号名")
private String loginname;
/**
*
*/
@ApiModelProperty(value = "用户姓名")
private String username;
/**
* id
*/
@ApiModelProperty(value = "用户id")
private String userid;
/**
*
*/
@ApiModelProperty(value = "权限")
private String email;
/**
*
*/
@ApiModelProperty(value = "手机号码")
private String mobileno;
/**
* ep-
*/
@ApiModelProperty(value = "用户类型ep-表示法人用户")
private String usertype;
/**
* legal-,admin-,user
*/
@ApiModelProperty(value = "角色类型legal-法定代表人,admin-管理员,user-业务经办")
private String roletype;
/**
* token
*/
@ApiModelProperty(value = "若依token")
private String token;
@ApiModelProperty(value = "企业机构代码")
private UserMainResponse main;
}

@ -1,15 +0,0 @@
package com.ruoyi.gysl.login.service;
/**
*
* @author du
* @since 2025/5/9 2:24
*/
public interface LoginTokenService {
/**
* token
*/
String singleLogin(String accountName, String name, String b, String mobile,String email);
}

@ -1,94 +0,0 @@
package com.ruoyi.gysl.login.service;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
*
*
* @author du
* @since 2025/5/9 2:30
*/
@Service
public class LoginTokenServiceImpl implements LoginTokenService {
@Resource
private ISysUserService userService;
@Resource
private AuthenticationManager authenticationManager;
@Resource
private TokenService tokenService;
@Override
public String singleLogin(String accountName,
String name,
String type,
String mobile,
String email) {
// 用户验证
Authentication authentication;
try {
SysUser user = new SysUser();
user.setUserName(accountName);
user.setNickName(name);
user.setPassword("Gysl@2025//**...");
user.setPhonenumber(mobile);
user.setEmail(email);
Long[] roles = new Long[1];
if ("01".equals(type)) {
if("jjdntest".equals(accountName)||"yanyq".equals(accountName)){
roles[0] = 101L;
}else {
roles[0] = 2L;
}
} else if ("02".equals(type)) {
roles[0] = 100L;
}
user.setRoleIds(roles);
user.setStatus("0");
//如果用户名也就是信用代码没有重复的就新增用户
if (userService.checkUserNameUnique(user)) {
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
userService.insertUser(user);
}
//新增user账号密码
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(accountName, "Gysl@2025//**...");
AuthenticationContextHolder.setContext(authenticationToken);
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager.authenticate(authenticationToken);
} catch (Exception e) {
if (e instanceof BadCredentialsException) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(accountName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
} else {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(accountName, Constants.LOGIN_FAIL, e.getMessage()));
throw new ServiceException(e.getMessage());
}
} finally {
AuthenticationContextHolder.clearContext();
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(accountName, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
return tokenService.createToken(loginUser);
}
}

@ -1,74 +0,0 @@
package com.ruoyi.gysl.login.util;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
/**
*
*
* @author du
* @since 2024/6/20 10:15
*/
public class HMAC256Config {
/**
*
*/
private final static String ENCODING = "utf-8";
/**
*
*/
private final static String ALGORITHM = "AES";
/**
*
*/
private final static String PATTERN = "AES/CBC/pkcs5padding";
//AES解密
/**
* @param content
* @param key aes
* @return
* @throws Exception
*/
public static String decrypt(String content, String key) throws Exception {
//反序列化AES密钥
SecretKeySpec keySpec = new SecretKeySpec(Base64.decodeBase64(key.getBytes()), ALGORITHM);
//128bit全零的IV向量
byte[] iv = new byte[16];
for (int i = 0; i < iv.length; i++) {
iv[i] = 0;
}
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
//初始化加密器并加密
Cipher deCipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
deCipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec);
byte[] encryptedBytes = Base64.decodeBase64(content.getBytes(ENCODING));
byte[] bytes = deCipher.doFinal(encryptedBytes);
return new String(bytes);
}
public static byte[] HmacSHA256(String data, String key) throws Exception {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] array = sha256_HMAC.doFinal(data.getBytes(StandardCharsets.UTF_8));
return array;
}
}

@ -1,134 +0,0 @@
package com.ruoyi.gysl.login.util;
import cn.hutool.crypto.SmUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.gysl.entity.Enterprise;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
/**
*
*
* @author du
* @since 2025/5/29 1:49
*/
@Service
public class HttpGetDataUtil {
private static final String BOUNDARY = "----WebKitFormBoundary7MA4YWxkTrZu0gW"; // 边界字符串(需唯一)
@Value("${sm2}")
private String sm2;
@Value("${isZs}")
private Boolean isZs;
@Value("${sm4}")
private String sm4;
@Value("${dataUrl}")
private String dataUrl;
@Value("${accessId}")
private String accessId;
@Value("${sceneId}")
private String sceneId;
public Enterprise getEnterpriseData(String tyshxydm) throws Exception {
if (isZs) {
String contacts = dataUrl + "frjbxxtyshxydm";
String a1 = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec(tyshxydm.getBytes(),
"ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
String a2 = Base64.getEncoder().encodeToString((byte[])
SM4Demo.exec("0".getBytes(),
"ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
// String a3 = Base64.getEncoder().encodeToString((byte[])
// SM4Demo.exec("10".getBytes(),
// "ECB", "PKCS5Padding", "random", sm4.getBytes(), null));
//生成sm3签名
String input = "pageIndex=0" + "&tyshxydm=" + tyshxydm;
try {
// 1. 构建 URL含签名参数处理特殊符号
String encodedSignature = URLEncoder.encode(SmUtil.sm3(input), "UTF-8")
.replace("+", "%20"); // 确保 + 不被编码为空格
String fullUrl = contacts + "?signature=" + encodedSignature;
// 2. 创建连接
URL url = new URL(fullUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
// 3. 构建请求体(严格对齐 curl -F 格式)
try (DataOutputStream out = new DataOutputStream(conn.getOutputStream())) {
writeFormField(out, "pageIndex", a2);
writeFormField(out, "tyshxydm", a1);
// 结束标记
out.writeBytes("--" + BOUNDARY + "--\r\n");
}
// 4. 处理响应
int statusCode = conn.getResponseCode();
StringBuilder response = getResponse(statusCode, conn);
if (statusCode == 200) {
JSONObject jsonObj = JSONUtil.parseObj(String.valueOf(response));
if ("200".equals(jsonObj.get("code"))) { // 使用 getString 避免类型问题
// 直接获取 data 字段为 JSONObject无需转换 String
JSONObject reqData = jsonObj.getJSONObject("data");
String responseParams = reqData.getStr("responseParams");
String s = new String((byte[]) SM2Demo.dexec(
Base64.getDecoder().decode(responseParams), "C1C2C3",
Base64.getDecoder().decode(sm2)),
StandardCharsets.UTF_8);
System.out.println(s);
JSONObject finalData = JSONUtil.parseObj(s);
JSONArray arr = finalData.getJSONArray("data");
if (finalData.getInt("total") > 0) {
return JSONUtil.toBean(arr.getJSONObject(0).toString(), Enterprise.class);
} else {
return null;
}
}
}
} catch (Exception y) {
y.printStackTrace();
}
}
return null;
}
private StringBuilder getResponse(int statusCode, HttpURLConnection conn) throws IOException {
StringBuilder response = new StringBuilder();
try (BufferedReader in = new BufferedReader(new InputStreamReader(
(statusCode >= 200 && statusCode < 300) ? conn.getInputStream() : conn.getErrorStream(),
StandardCharsets.UTF_8))) {
String line;
while ((line = in.readLine()) != null) {
response.append(line);
}
}
return response;
}
private void writeFormField(DataOutputStream out, String name, String value) throws Exception {
out.writeBytes("--" + BOUNDARY + "\r\n");
out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n");
out.writeBytes("Content-Type: text/plain; charset=UTF-8\r\n\r\n");
out.writeBytes(value + "\r\n");
}
}

@ -1,113 +0,0 @@
package com.ruoyi.gysl.login.util;
import org.bouncycastle.crypto.engines.SM2Engine;
import org.bouncycastle.crypto.engines.SM2Engine.Mode;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.crypto.params.ParametersWithRandom;
import org.bouncycastle.jce.interfaces.ECPrivateKey;
import org.bouncycastle.jce.interfaces.ECPublicKey;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.Security;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
public class SM2Demo {
/**
* SM2RSA
*/
private static final String ALGORITHM = "SM2";
private static final String SM2 = "EC";
private static final String C1C2C3 = "C1C2C3";
/**
*
* @param objects
* @return
* @throws Exception
*/
public static Object exec(Object... objects) throws Exception {
if (objects == null || objects.length != 3) {
return null;
}
byte[] message = (byte[]) objects[0];
String order = objects[1].toString();
byte[] publicKey = (byte[]) objects[2];
ECPublicKey ecPublicKey = (ECPublicKey) KeyFactory.getInstance(SM2, new BouncyCastleProvider())
.generatePublic(new X509EncodedKeySpec(publicKey));
ECPublicKeyParameters ecPublicKeyParameters = getPublicKeyParameters(ecPublicKey);
Mode mode = order.equals(C1C2C3) ? Mode.C1C2C3 : Mode.C1C3C2;
SM2Engine sm2Engine = new SM2Engine(mode);
sm2Engine.init(true, new ParametersWithRandom(ecPublicKeyParameters));
return sm2Engine.processBlock(message, 0, message.length);
}
/**
*
* @param objects
* @return
* @throws Exception
*/
public static Object dexec(Object... objects) throws Exception {
if (objects == null || objects.length != 3) {
return null;
}
byte[] message = (byte[]) objects[0];
String order = objects[1].toString();
byte[] privateKey = (byte[]) objects[2];
ECPrivateKey ecPrivateKey = (ECPrivateKey) KeyFactory.getInstance(SM2, new BouncyCastleProvider())
.generatePrivate(new PKCS8EncodedKeySpec(privateKey));
ECPrivateKeyParameters privateKeyParameters = getPrivateKeyParameters(ecPrivateKey);
Mode mode = order.equals(C1C2C3) ? Mode.C1C2C3 : Mode.C1C3C2;
SM2Engine sm2Engine = new SM2Engine(mode);
sm2Engine.init(false, privateKeyParameters);
return sm2Engine.processBlock(message, 0, message.length);
}
private static ECPublicKeyParameters getPublicKeyParameters(ECPublicKey ecPublicKey) {
ECParameterSpec parameterSpec = ecPublicKey.getParameters();
ECCurve curve = parameterSpec.getCurve();
ECPoint g = parameterSpec.getG();
BigInteger n = parameterSpec.getN();
BigInteger h = parameterSpec.getH();
ECDomainParameters domainParams = new ECDomainParameters(curve, g, n, h);
return new ECPublicKeyParameters(ecPublicKey.getQ(), domainParams);
}
private static ECPrivateKeyParameters getPrivateKeyParameters(ECPrivateKey ecPrivateKey) {
ECParameterSpec parameterSpec = ecPrivateKey.getParameters();
ECCurve curve = parameterSpec.getCurve();
ECPoint g = parameterSpec.getG();
BigInteger n = parameterSpec.getN();
BigInteger h = parameterSpec.getH();
ECDomainParameters domainParams = new ECDomainParameters(curve, g, n, h);
return new ECPrivateKeyParameters(ecPrivateKey.getD(), domainParams);
}
// public static void main(String[] args) throws Exception {
// SM2Demo computeFactor = new SM2Demo();
// String pub = "XXXX";//公钥
// String pri = "XXXX";//私钥
// //待加密字符串
// String text = "XXXXXXXXXXXXXX";
// Object result = computeFactor
// .exec(text.getBytes(StandardCharsets.UTF_8), "C1C2C3", Base64.getDecoder().decode(pub));
// System.out.println("加密: " + Base64.getEncoder().encodeToString((byte[]) result));
// //待解密base64编码
// String encode = "XXXXXXXXXXXXX";
// Object result1 = computeFactor.dexec(Base64.getDecoder().decode(encode), "C1C2C3", Base64.getDecoder().decode(pri));
// System.out.println("解密: " + new String((byte[]) result1, StandardCharsets.UTF_8));
// }
}

@ -1,103 +0,0 @@
package com.ruoyi.gysl.login.util;
import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.Charset;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.Security;
import java.util.Base64;
public class SM4Demo {
/**
* SM4 DES
*/
private static final String ALGORITHM = "SM4";
private static final Integer KEY_SIZE = 128;
static {
Security.addProvider(new BouncyCastleProvider());
}
public static Key getKey(String algorithm, int length, String passwordType, byte[] password)
throws NoSuchAlgorithmException {
Key key;
if (passwordType == null || passwordType.equals("fix")) {
key = new SecretKeySpec(password, algorithm);
} else {
KeyGenerator keyGenerator = KeyGenerator.getInstance(algorithm);
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(password);
keyGenerator.init(length, secureRandom);
SecretKey secretKey = keyGenerator.generateKey();
key = new SecretKeySpec(secretKey.getEncoded(), algorithm);
}
return key;
}
public static Cipher getCipher(Key key, String algorithm, String mode, String padding, int encryptMode, byte[] iv,
BouncyCastleProvider provider)
throws Exception {
Cipher cipher = Cipher.getInstance(StringUtils.join(new String[]{algorithm, mode, padding}, "/"), provider);
if (mode.equals("ECB")) {
cipher.init(encryptMode, key);
} else if (mode.equals("CBC") && iv != null) {
IvParameterSpec ivSpec = new IvParameterSpec(iv);
cipher.init(encryptMode, key, ivSpec);
}
return cipher;
}
public static Object exec(Object... objects) throws Exception {
if (objects == null || objects.length != 6) {
return null;
}
byte[] message = (byte[]) objects[0];
String mode = objects[1].toString();
String padding = objects[2].toString();
String passwordType = objects[3].toString();
byte[] password = (byte[]) objects[4];
byte[] iv = (byte[]) objects[5];
Key key = SM4Demo.getKey(ALGORITHM, KEY_SIZE, passwordType, password);
Cipher cipher = SM4Demo
.getCipher(key, ALGORITHM, mode, padding, Cipher.ENCRYPT_MODE, iv, new BouncyCastleProvider());
return cipher.doFinal(message);
}
public static Object dexec(Object... objects) throws Exception {
if (objects == null || objects.length != 6) {
return null;
}
byte[] message = (byte[]) objects[0];
String mode = objects[1].toString();
String padding = objects[2].toString();
String passwordType = objects[3].toString();
byte[] password = (byte[]) objects[4];
byte[] iv = (byte[]) objects[5];
Key key = SM4Demo.getKey(ALGORITHM, KEY_SIZE, passwordType, password);
Cipher cipher = SM4Demo
.getCipher(key, ALGORITHM, mode, padding, Cipher.DECRYPT_MODE, iv, new BouncyCastleProvider());
return cipher.doFinal(message);
}
// public static void main(String[] args) throws Exception {
// //待加密字符串
// String content = "91320594067622605M";
// SM4Demo computeFactor = new SM4Demo();
// Object result = computeFactor
// .exec(content.getBytes(), "ECB", "PKCS5Padding", "random", "ef5323158e0d43e69442718cd4932116".getBytes(),
// null);
// System.out.println(Base64.getEncoder().encodeToString((byte[]) result));
// //待解密的字符串
// String encodeSM2String="t/lpTpuW6JeN+JhACXkWqWeHr55Bwj5BTBgMmG5a9+w=";
// Object result2 = computeFactor.dexec(Base64.getDecoder().decode(encodeSM2String), "ECB", "PKCS5Padding", "random", "ef5323158e0d43e69442718cd4932116".getBytes(),null);
// System.out.println(new String((byte[]) result2, Charset.forName("utf-8")));
//
// }
}

@ -1,173 +0,0 @@
package com.ruoyi.gysl.login.util;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.gysl.entity.response.JgysbabResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
*
* @author du
* @since 2024/6/20 10:15
*/
public class StringUtil {
public static List<JgysbabResponse> getFinalData(String content) throws Exception {
String result = content.replaceAll(", pdfBase64=[^,}]*", "");
//pdfbase64保存的集合
List<String> segments = new ArrayList<>();
Pattern pattern = Pattern.compile(", pdfBase64=([^,]+)");
Matcher matcher = pattern.matcher(content);
while (matcher.find()) {
segments.add(matcher.group(1));
}
JSONObject newS = JSONObject.parseObject(result);
// 1. 分割多个对象
List<String> objects = splitObjects(newS.getString("data"));
List<String> jsonObjects = new ArrayList<>();
// 2. 遍历每个对象并解析
for (String obj : objects) {
jsonObjects.add(parseObject(obj));
}
// 3. 构建最终 JSON 数组
String json = buildJsonArray(jsonObjects);
JSONArray newArray = JSONArray.parseArray(json);
// 转换为 Java 对象列表
List<JgysbabResponse> returnData = new ArrayList<>();
for (int i = 0; i < newArray.size(); i++) {
JSONObject item = newArray.getJSONObject(i);
JgysbabResponse res = item.toJavaObject(JgysbabResponse.class);
res.setPdfBase64(segments.get(i));
returnData.add(res);
}
return returnData;
}
/**
*
*/
private static List<String> splitObjects(String input) {
List<String> objects = new ArrayList<>();
int start = input.indexOf('{') + 1;
int depth = 0;
StringBuilder currentObj = new StringBuilder();
for (int i = start; i < input.length(); i++) {
char c = input.charAt(i);
if (c == '{') {
depth++;
}
if (c == '}') {
if (depth == 0) {
objects.add(currentObj.toString());
currentObj.setLength(0);
i++; // 跳过下一个逗号或闭合括号
} else {
depth--;
}
}
if (depth >= 0) {
currentObj.append(c);
}
}
return objects;
}
/**
*
*/
private static String parseObject(String objStr) {
List<String[]> keyValuePairs = new ArrayList<>();
StringBuilder key = new StringBuilder();
StringBuilder value = new StringBuilder();
boolean isKey = true;
boolean inQuotes = false;
for (int i = 0; i < objStr.length(); i++) {
char c = objStr.charAt(i);
// 处理转义字符
if (c == '\\' && i < objStr.length() - 1) {
char next = objStr.charAt(++i);
if (isKey) {
key.append(next);
} else {
value.append(next);
}
continue;
}
// 处理引号
if (c == '"') {
inQuotes = !inQuotes;
continue;
}
// 键值分隔符(不在引号内)
if (c == '=' && !inQuotes && isKey) {
isKey = false;
continue;
}
// 键值对结束符(不在引号内)
if (c == ',' && !inQuotes) {
keyValuePairs.add(new String[]{key.toString().trim(), value.toString().trim()});
key.setLength(0);
value.setLength(0);
isKey = true;
continue;
}
// 积累字符
if (isKey) {
key.append(c);
} else {
value.append(c);
}
}
// 添加最后一个键值对
if (key.length() > 0) {
keyValuePairs.add(new String[]{key.toString().trim(), value.toString().trim()});
}
return buildJsonObject(keyValuePairs);
}
/**
* JSON
*/
private static String buildJsonObject(List<String[]> pairs) {
StringBuilder json = new StringBuilder("{");
for (int i = 0; i < pairs.size(); i++) {
String[] pair = pairs.get(i);
json.append('"')
.append(pair[0])
.append("\":\"")
.append(pair[1].replace("\"", "\\\"")) // 处理值中的双引号
.append('"');
if (i < pairs.size() - 1) {
json.append(",");
}
}
return json.append("}").toString();
}
/**
* JSON
*/
private static String buildJsonArray(List<String> objects) {
StringBuilder json = new StringBuilder("[");
for (int i = 0; i < objects.size(); i++) {
json.append(objects.get(i));
if (i < objects.size() - 1) {
json.append(",");
}
}
return json.append("]").toString();
}
}

@ -31,8 +31,6 @@ public interface BasicInformationMapper extends BaseMapper<BasicInformation> {
* @return
*/
Page<BasicInformation> page(Page<BasicInformation> page, @Param("req") BasicInformationPageReq req);
/**
*
*/

@ -1,14 +1,7 @@
package com.ruoyi.gysl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.GyslProjectHandbook;
import com.ruoyi.gysl.entity.request.HandbookRequest;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
import java.util.List;
/**
* (gysl_project_handbook)访
@ -18,17 +11,5 @@ import java.util.List;
*/
public interface ProjectHandBookMapper extends BaseMapper<GyslProjectHandbook> {
/**
*
*
* @param g
* @return
*/
Page<GyslProjectHandbook> page(Page<GyslProjectHandbook> a1,@Param("req") HandbookRequest g);
/**
* id
*/
List<BasicInformation> getProjectName(@Param("id") List<String> id);
}

@ -19,10 +19,10 @@ public interface QyStatsMapper {
*/
AllProjectResponse allProject(@Param("userName") String userName);
// /**
// * 关联项目
// */
// List<BasicInformation> relationalProject(String username);
/**
*
*/
List<BasicInformation> relationalProject(String username);
/**
*

@ -6,8 +6,6 @@ import com.ruoyi.gysl.entity.Xmzsk;
import com.ruoyi.gysl.entity.request.XmzskPageReq;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (Xmzsk)访
*
@ -24,6 +22,5 @@ public interface XmzskMapper extends BaseMapper<Xmzsk> {
* @return
*/
Page<Xmzsk> page(Page<Xmzsk> page,@Param("req") XmzskPageReq req);
List<Xmzsk> page( @Param("req") XmzskPageReq req);
}

@ -1,9 +1,6 @@
package com.ruoyi.gysl.mapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.docking.entity.SmartDeclaration;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import org.apache.ibatis.annotations.Param;
@ -61,13 +58,5 @@ public interface ZwStatsMapper {
*
*/
int allMlfx();
/**
*
*/
List<RibbonResponse> cbxmtj();
}

@ -5,9 +5,6 @@ import com.ruoyi.docking.entity.SmartReminders;
import com.ruoyi.docking.service.*;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.service.BasicInformationService;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -25,16 +22,17 @@ import java.util.List;
* @author du
* @since 2025/3/23 16:35
*/
@Configuration
@EnableScheduling
//@Component
//@Configuration
//@EnableScheduling
@Component
public class NoticeTiming {
@Resource
private ProjectProgressService projectProgressService;
@Resource
private ProjectService projectService;
@Resource
private SmartRemindersService smartRemindersService;
@ -52,20 +50,34 @@ public class NoticeTiming {
/**
*
*/
@Scheduled(cron = "0 0 0 1 * ?")
// @Scheduled(cron = "0 0 0 1 * ?")
private void configureTasks() {
userService.getAllZwUser(LocalDate.now().getYear() +
"年" +
LocalDate.now().getMonth().getValue() +
"月" +
"项目进展未填写", null, null, String.valueOf(LocalDate.now().getMonth().getValue()));
"项目进展未填写", null, null, null);
}
/**
* 12
*/
// @Scheduled(cron = "0 0 2 1 * ?") // 每月1号 2:00:00 执行
// private void changeProgress() {
// List<ProjectProgress> pList = projectProgressService.djList();
// //修改该progressId为空
// pList.forEach(x-> x.setProgressId(null));
// //批量新增
// projectProgressService.saveBatch(pList);
//
// List<Project> pjList = projectService.djList();
// projectService.saveBatch(pjList);
// }
/**
*
*/
@Scheduled(cron = "0 40 1 * * *")
// @Scheduled(cron = "0 40 1 * * *")
public void changeNdq() {
//获取企业的不定时提醒
SmartReminders qy = smartRemindersService.getById(1);
@ -108,8 +120,4 @@ public class NoticeTiming {
throw new IllegalArgumentException("无效的日期格式: " + dateStr, e);
}
}
/**
*
*/
}

@ -1,18 +1,13 @@
package com.ruoyi.gysl.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itextpdf.layout.Document;
import com.ruoyi.gysl.entity.GyslProjectHandbook;
import com.ruoyi.gysl.entity.request.HandbookRequest;
import com.ruoyi.gysl.entity.response.BasicInformationResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.util.List;
/**
* (GyslProjectHandbook)
@ -22,15 +17,6 @@ import java.util.List;
*/
public interface GyslProjectHandbookService extends IService<GyslProjectHandbook> {
/**
*
*
* @param
* @param g
* @return
*/
Page<GyslProjectHandbook> page(Page<GyslProjectHandbook> a1, HandbookRequest g);
/**
* pdf
@ -38,14 +24,9 @@ public interface GyslProjectHandbookService extends IService<GyslProjectHandbook
void generatePdfs(HttpServletResponse response,Integer id) throws IOException;
/**
*
*/
String changeData(String s, BasicInformationResponse b) ;
/**
*
*
*/
GyslProjectHandbook getData(Serializable id);
void addCoverPage(Document document, GyslProjectHandbook gyslProjectHandbook) throws MalformedURLException;
}

@ -19,10 +19,10 @@ public interface QyStatsService {
*/
AllProjectResponse allProject(String userName);
// /**
// * 关联项目
// */
// List<BasicInformation> relationalProject(String username);
/**
*
*/
List<BasicInformation> relationalProject(String username);
/**

@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.gysl.entity.Xmzsk;
import com.ruoyi.gysl.entity.request.XmzskPageReq;
import java.util.List;
/**
* (Xmzsk)
*
@ -22,6 +20,5 @@ public interface XmzskService extends IService<Xmzsk> {
* @return
*/
Page<Xmzsk> page(Page<Xmzsk> page, XmzskPageReq req);
List<Xmzsk> page(XmzskPageReq req);
}

@ -1,8 +1,6 @@
package com.ruoyi.gysl.service;
import com.ruoyi.docking.entity.SmartDeclaration;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
@ -56,12 +54,5 @@ public interface ZwStatsService {
*
*/
List<RibbonResponse> slfx();
/**
*
*/
List<RibbonResponse> cbxmtj();
}

@ -29,7 +29,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -191,13 +190,12 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
if (status == 2) {
if (oldStatus == 1) {
userService.getAllZwUser("关于" + req.getBasicInformation().getName() + "项目,待审核的通知", req.getBasicInformation().getId(), null, String.valueOf(LocalDateTime.now()));
userService.getAllZwUser("关于" + req.getBasicInformation().getName() + "项目,待审核的通知", req.getBasicInformation().getId(), null, null);
}
}
if (status == 3) {
if (oldStatus == 2) {
SmartDeclaration sd = new SmartDeclaration();
sd.setAlertTime(LocalDateTime.now());
sd.setTyshxydm((req.getBasicInformation().getTyshxydm()));
sd.setProjectId(req.getBasicInformation().getId());
sd.setContent("关于" + req.getBasicInformation().getName() + "项目,审核通过的通知");

@ -2,9 +2,9 @@ package com.ruoyi.gysl.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.gysl.entity.Enterprise;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.mapper.EnterpriseMapper;
import com.ruoyi.gysl.entity.Enterprise;
import com.ruoyi.gysl.service.EnterpriseService;
import org.springframework.stereotype.Service;

@ -1,38 +1,47 @@
package com.ruoyi.gysl.service.impl;
import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itextpdf.html2pdf.ConverterProperties;
import com.itextpdf.html2pdf.HtmlConverter;
import com.itextpdf.io.font.PdfEncodings;
import com.itextpdf.io.image.ImageData;
import com.itextpdf.io.image.ImageDataFactory;
import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.utils.PdfMerger;
import com.itextpdf.layout.font.FontProvider;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.AreaBreak;
import com.itextpdf.layout.element.Image;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.properties.HorizontalAlignment;
import com.itextpdf.layout.properties.TextAlignment;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.gysl.entity.*;
import com.ruoyi.gysl.entity.request.HandbookRequest;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.gysl.entity.GyslProjectHandbook;
import com.ruoyi.gysl.entity.response.BasicInformationResponse;
import com.ruoyi.gysl.mapper.BasicInformationMapper;
import com.ruoyi.gysl.mapper.ProjectHandBookMapper;
import com.ruoyi.gysl.service.*;
import com.ruoyi.system.mapper.SysDictDataMapper;
import lombok.extern.slf4j.Slf4j;
import com.ruoyi.gysl.service.GyslProjectHandbookService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.rmi.ServerError;
import java.util.Arrays;
import java.util.List;
/**
* (GyslProjectHandbook)
@ -40,246 +49,87 @@ import java.util.*;
* @author makejava
* @since 2025-04-14 13:56:59
*/
@Slf4j
@Service("gyslProjectHandbookService")
public class GyslProjectHandbookServiceImpl extends ServiceImpl<ProjectHandBookMapper, GyslProjectHandbook> implements GyslProjectHandbookService {
@Resource
private BasicInformationMapper basicInformationMapper;
/**
*
*/
@Resource
private BuildingInformationService buildingInformationService;
/**
*
*/
@Resource
private QyrzInformationService qyrzInformationService;
@Resource
private BasicInformationService basicInformationService;
/**
*
*/
@Resource
private PlanInformationService planInformationService;
@Resource
private SysDictDataMapper sysDictDataMapper;
/**
*
*
* @param g
* @return
*/
@Override
public Page<GyslProjectHandbook> page(Page<GyslProjectHandbook> a1, HandbookRequest g) {
return baseMapper.page(a1, g);
}
@Override
public void generatePdfs(HttpServletResponse response, Integer id) throws IOException {
// 获取数据
GyslProjectHandbook handbook = getById(id);
// List<BasicInformationResponse> basicInfoList = basicInformationMapper.idListToProject(
// Arrays.asList(handbook.getXmId().split(",")));
String[] list = handbook.getXmId().split(",");
List<BasicInformationResponse> basicInfoList = new ArrayList<>();
for (String s : list) {
BasicInformationResponse bs = new BasicInformationResponse();
//项目基本信息
BasicInformation byId = basicInformationService.getById(s);
bs.setBasicInformation(byId == null ? new BasicInformation() : byId);
//项目规划信息
PlanInformation one = planInformationService.lambdaQuery().eq(PlanInformation::getXmId, s).one();
bs.setPlanInformation(one == null ? new PlanInformation() : one);
//项目建筑信息
bs.setBuildingInformation(buildingInformationService.lambdaQuery().eq(BuildingInformation::getXmId, s).list());
//企业入驻信息
ZwIdPageReq zwIdPageReq = new ZwIdPageReq();
zwIdPageReq.setXmId(Long.valueOf(s));
QyrzInformation qyrzInformation = qyrzInformationService.selectAll(zwIdPageReq);
bs.setQyrzInformation(qyrzInformation == null ? new QyrzInformation() : qyrzInformation);
basicInfoList.add(bs);
}
List<String> hbpdf = new ArrayList<>();
// 配置中文字体
String fontPath = RuoYiConfig.getProfile() + "/Alibaba-PuHuiTi-Regular.ttf";
FontProvider fontProvider = new FontProvider();
fontProvider.addFont(fontPath, PdfEncodings.IDENTITY_H);
// 转换参数
ConverterProperties props = new ConverterProperties();
props.setFontProvider(fontProvider);
//封面
String htmlHead = RuoYiConfig.getProfile() + "/head.txt";
String s = getHtml(htmlHead);
s = s.replace("{{scname}}", handbook.getName() != null ? handbook.getName() : "/");
s = s.replace("{{subtitleone}}", handbook.getSubtitle1() != null ? handbook.getSubtitle1() : "/");
s = s.replace("{{subtitletwo}}", handbook.getSubtitle2() != null ? handbook.getSubtitle2() : "/");
s = s.replace("{{fmimgurl}}", Paths.get(RuoYiConfig.getProfile() + "/1.png").toUri().toString());
String headPdf = RuoYiConfig.getProfile() + "/pdfml" + "/head" + ".pdf";
hbpdf.add(headPdf);
FileUtil.touch(headPdf);
try (PdfWriter writer = new PdfWriter(headPdf);
PdfDocument pdf = new PdfDocument(writer)) {
HtmlConverter.convertToPdf(s, pdf, props);
}
//内容目录
String htmlUrl = RuoYiConfig.getProfile() + "/gysl.txt";
String original = getHtml(htmlUrl);
for (int i = 0; i < basicInfoList.size(); i++) {
//查看每个项目对应的附件
StringBuilder result = new StringBuilder(original);
if (basicInfoList.get(i).getBasicInformation().getFj() != null) {
String[] split = basicInfoList.get(i).getBasicInformation().getFj().split(",");
String target = "<!-- 图片区域 -->"; // 要查找的子字符串
int startIndex = original.indexOf(target);
if (startIndex == -1) {
throw new IllegalArgumentException("未找到目标子字符串");
}
int insertPosition = startIndex + target.length();
result = new StringBuilder(original.substring(0, insertPosition));
for (int i1 = 0; i1 < split.length; i1++) {
String changeStr = "<div class=\"image-container\">\n" +
"\t\t<img src=\"{{fjimg"+i1+"}}\" alt=\"\" class=\"content-img\">\n" +
"\t</div>"; // 要插入的内容
result.append(changeStr);
}
result.append(original.substring(insertPosition));
}
//获取当前的信息并替换为可用html
String htmlNew = changeData(String.valueOf(result), basicInfoList.get(i));
//新建pdf
String newPdf = "/pdfml" + "/p" + i + ".pdf";
String outputPath = RuoYiConfig.getProfile() + newPdf;
hbpdf.add(outputPath);
FileUtil.touch(outputPath);
try (PdfWriter writer = new PdfWriter(outputPath);
PdfDocument pdf = new PdfDocument(writer)) {
HtmlConverter.convertToPdf(htmlNew, pdf, props);
}
}
//封尾
String htmlFoot = RuoYiConfig.getProfile() + "/foot.txt";
String a = getHtml(htmlFoot);
a = a.replace("{{dwname}}", handbook.getDwname() != null ? handbook.getDwname() : "/");
a = a.replace("{{name}}", handbook.getLxname() != null ? handbook.getLxname() : "/");
a = a.replace("{{phone}}", handbook.getPhone() != null ? handbook.getPhone() : "/");
a = a.replace("{{date}}", handbook.getDate() != null ? handbook.getDate() : "/");
a = a.replace("{{Address}}", handbook.getAddress() != null ? handbook.getAddress() : "/");
a = a.replace("{{fmimgurl}}",
Paths.get(RuoYiConfig.getProfile() + "/2.png").toUri().toString());
String foodPdf = RuoYiConfig.getProfile() + "/pdfml" + "/food" + ".pdf";
hbpdf.add(foodPdf);
FileUtil.touch(foodPdf);
try (PdfWriter writer = new PdfWriter(foodPdf); PdfDocument pdf = new PdfDocument(writer)) {
HtmlConverter.convertToPdf(a, pdf, props);
}
// 创建内存输出流替代写入ceshi.pdf文件
ByteArrayOutputStream mergedPdfStream = new ByteArrayOutputStream();
// 初始化PdfWriter指向内存流
PdfWriter writer = new PdfWriter(mergedPdfStream);
PdfDocument mergedPdfDoc = new PdfDocument(writer);
PdfMerger merger = new PdfMerger(mergedPdfDoc);
// 合并所有PDF
for (String src : hbpdf) {
try (PdfDocument srcDoc = new PdfDocument(new PdfReader(src))) {
merger.merge(srcDoc, 1, srcDoc.getNumberOfPages());
}
}
merger.close();
mergedPdfDoc.close(); // 关闭合并的PDF文档
//删除临时生成的pdfml文件夹及其内容
String pdfmlDirPath = RuoYiConfig.getProfile() + "/pdfml";
try {
FileUtil.del(pdfmlDirPath); // Hutool工具类删除文件夹含内部文件
} catch (Exception e) {
log.error("删除临时文件夹失败: {}");
// 可根据需要决定是否抛出异常或仅记录日志
}
List<BasicInformationResponse> basicInfoList = basicInformationMapper.idListToProject(
Arrays.asList(handbook.getXmId().split(",")));
// 设置响应头
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\"product_catalog.pdf\"");
response.setContentLength(mergedPdfStream.size());
// 将内存流写入HTTP响应
try (OutputStream out = response.getOutputStream()) {
mergedPdfStream.writeTo(out);
out.flush();
try (OutputStream outputStream = response.getOutputStream();
PdfWriter writer = new PdfWriter(outputStream);
PdfDocument mergedPdf = new PdfDocument(writer)) { // 主文档生命周期由外部try控制
// ========== 封面页 ==========
Document coverDoc = new Document(mergedPdf);
addCoverPage(coverDoc, handbook);
coverDoc.close(); // 关闭封面Document但不关闭PdfDocument
// ========== 动态内容合并 ==========
String htmlContent = "<!DOCTYPE html><html><body style='font-family: SimSun;'>动态内容</body></html>";
try (ByteArrayOutputStream tempStream = new ByteArrayOutputStream()) {
// HTML转PDF
HtmlConverter.convertToPdf(htmlContent, tempStream);
// 合并到主文档
try (PdfReader tempReader = new PdfReader(new ByteArrayInputStream(tempStream.toByteArray()));
PdfDocument tempPdf = new PdfDocument(tempReader)) {
PdfMerger merger = new PdfMerger(mergedPdf);
merger.merge(tempPdf, 1, tempPdf.getNumberOfPages());
}
}
/**
* htmlstring
*/
public static String getHtml(String htmlUrl) {
StringBuilder html = new StringBuilder();
try (Scanner scanner = new Scanner(
new File(htmlUrl),
StandardCharsets.UTF_8.name()) // 显式指定UTF-8
) {
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
html.append(line);
}
} catch (IOException e) {
throw new ServiceException("读取HTML文件失败!");
} catch (Exception e) {
response.reset();
response.setContentType("application/json");
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
throw new ServiceException("错误!");
}
return html.toString();
}
@Override
public String changeData(String handbook, BasicInformationResponse b) {
List<SysDictData> sysDictData = sysDictDataMapper.selectDictDataList(new SysDictData());
Map<String, Object> dt = new HashMap<>();
if (b.getBasicInformation().getFj() != null) {
String[] split = b.getBasicInformation().getFj().split(",");
for (int i = 0; i < split.length; i++) {
dt.put("{{fjimg"+i+"}}",
Paths.get(RuoYiConfig.getProfile() + StringUtils.substringAfter(split[i], Constants.RESOURCE_PREFIX)).toUri().toString());
}
}
dt.put("{{name}}", b.getBasicInformation().getName());
dt.put("{{ztze}}", b.getBasicInformation().getZtze());
dt.put("{{xmbq}}", b.getBasicInformation().getLabel());
dt.put("{{prioritize}}", b.getBasicInformation().getPrioritize());
dt.put("{{xzfl}}", basicInformationService.getDictLabel("xzfl", String.valueOf(b.getBasicInformation().getXzfl()), sysDictData));
dt.put("{{jsms}}", basicInformationService.getDictLabel("jsms", String.valueOf(b.getBasicInformation().getJsms()), sysDictData));
dt.put("{{ssgnq}}", basicInformationService.getDictLabel("ssgnq", String.valueOf(b.getBasicInformation().getSsgnq()), sysDictData));
public void addCoverPage(Document document, GyslProjectHandbook handbook) throws MalformedURLException {
// 标题
Paragraph title = new Paragraph(handbook.getName())
.setFontSize(30).setBold().setFontColor(ColorConstants.BLUE)
.setTextAlignment(TextAlignment.CENTER)
.setMarginTop(60);
document.add(title);
dt.put("{{zjzmj}}", b.getPlanInformation().getZjzmj());
dt.put("{{zydmj}}", b.getPlanInformation().getZydmj());
dt.put("{{bzcjzmj}}", b.getPlanInformation().getBzcjzmj());
dt.put("{{zgjzgd}}", b.getPlanInformation().getZgjzgd());
dt.put("{{jzds}}", b.getPlanInformation().getJzds());
dt.put("{{zgjzcs}}", b.getPlanInformation().getZgjzcs());
dt.put("{{fhdj}}", b.getPlanInformation().getFhdj());
dt.put("{{jdctcw}}", b.getPlanInformation().getJdctcw());
dt.put("{{fjdctcw}}", b.getPlanInformation().getFjdctcw());
// 副标题
Paragraph subtitle = new Paragraph(handbook.getSubtitle())
.setFontSize(22).setFontColor(ColorConstants.BLUE)
.setTextAlignment(TextAlignment.RIGHT)
.setMarginTop(70);
document.add(subtitle);
dt.put("{{yczmj}}", b.getQyrzInformation().getYczmj());
dt.put("{{kzczmj}}", b.getQyrzInformation().getKzczmj());
dt.put("{{gycfpjzj}}", b.getQyrzInformation().getGycfpjzj());
dt.put("{{pjwyf}}", b.getQyrzInformation().getGycfpjwyf());
// 封面图片
String imgPath = RuoYiConfig.getProfile() +
StringUtils.substringAfter(handbook.getCoverImg(), Constants.RESOURCE_PREFIX);
// 动态替换所有模板变量
for (Map.Entry<String, Object> entry : dt.entrySet()) {
if (handbook.contains(entry.getKey())) {
handbook = handbook.replace(entry.getKey(), entry.getValue() != null ? entry.getValue().toString() : "/");
}
}
return handbook;
if (!FileUtils.checkAllowDownload(imgPath)) {
throw new ServiceException("非法文件路径: " + imgPath);
}
/**
*
*/
@Override
public GyslProjectHandbook getData(Serializable id) {
GyslProjectHandbook byId = getById(id);
byId.setProjectName(baseMapper.getProjectName(Arrays.asList(byId.getXmId().split(","))));
return byId;
ImageData imageData = ImageDataFactory.create(imgPath);
Image image = new Image(imageData)
.setWidth(400)
.setMarginTop(85)
.setHorizontalAlignment(HorizontalAlignment.CENTER);
document.add(image);
// 分页控制关键修改直接操作PdfDocument
document.getPdfDocument().addNewPage();
}
}

@ -30,13 +30,13 @@ public class QyStatsServiceImpl implements QyStatsService {
return qyStatsMapper.allProject(userName);
}
// /**
// * 关联项目
// */
// @Override
// public List<BasicInformation> relationalProject(String username) {
// return qyStatsMapper.relationalProject(username);
// }
/**
*
*/
@Override
public List<BasicInformation> relationalProject(String username) {
return qyStatsMapper.relationalProject(username);
}
/**
*

@ -8,8 +8,6 @@ import com.ruoyi.gysl.entity.Xmzsk;
import com.ruoyi.gysl.service.XmzskService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (Xmzsk)
*
@ -30,10 +28,5 @@ public class XmzskServiceImpl extends ServiceImpl<XmzskMapper, Xmzsk> implements
public Page<Xmzsk> page(Page<Xmzsk> page, XmzskPageReq req) {
return baseMapper.page(page,req);
}
@Override
public List<Xmzsk> page(XmzskPageReq req) {
return baseMapper.page(req);
}
}

@ -2,8 +2,6 @@ package com.ruoyi.gysl.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.docking.entity.SmartDeclaration;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import com.ruoyi.gysl.mapper.ZwStatsMapper;
@ -103,14 +101,4 @@ public class ZwStatsServiceImpl implements ZwStatsService {
a1.add(r2);
return a1;
}
/**
*
*/
@Override
public List<RibbonResponse> cbxmtj() {
return zwStatsMapper.cbxmtj();
}
}

@ -0,0 +1,232 @@
package com.ruoyi.gysl.utils;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Image;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.tool.xml.XMLWorkerFontProvider;
import com.itextpdf.tool.xml.XMLWorkerHelper;
import com.ruoyi.common.utils.http.HttpUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class HtmlToPdfConverter {
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
public static MultipartFile convertHtmlToPdf(String htmlArticleTitle, String htmlContent) throws IOException {
String ht = content2Html(htmlContent);
String path = System.getProperty("user.dir");
// 根据日期建文件夹
String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String[] split = format.split("-");
Path dirPath = Paths.get(path, "temporary", split[0], split[1], split[2]);
try {
// clearTemporaryDirectory(Paths.get(path, "temporary")); // 清理目录
Files.createDirectories(dirPath);
} catch (IOException e) {
throw new RuntimeException("创建文件夹失败: " + e.getMessage(), e);
}
File pdfFile = new File(dirPath.toFile(), "pdf-" + System.currentTimeMillis() + ".pdf");
// 创建PDF文档
Document document = new Document();
FileOutputStream fos = null;
InputStream is = null;
try {
fos = new FileOutputStream(pdfFile);
PdfWriter writer = PdfWriter.getInstance(document, fos);
XMLWorkerFontProvider fontProvider = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS);
fontProvider.register("C:/Windows/Fonts/simsun.ttc");
document.open();
// 添加标题
Paragraph paragraph = new Paragraph(htmlArticleTitle); // 设置你自定义的字体格式
document.add(paragraph);
String updatedHtmlContent = "";
if (htmlContent.contains("img")) {
updatedHtmlContent = replaceImgSrcWithBase64(ht);
if (updatedHtmlContent != null) {
is = new ByteArrayInputStream(updatedHtmlContent.getBytes(StandardCharsets.UTF_8));
XMLWorkerHelper.getInstance().parseXHtml(writer, document, is, StandardCharsets.UTF_8, fontProvider);
// 添加图片
Elements imgElements = Jsoup.parse(updatedHtmlContent).select("img");
for (Element img : imgElements) {
String imgSrc = img.attr("src");
if (imgSrc.startsWith("data:image/jpeg;base64,")) {
String base64Data = imgSrc.substring("data:image/jpeg;base64,".length());
byte[] imageBytes = Base64.getDecoder().decode(base64Data);
Image image = Image.getInstance(imageBytes);
document.add(image); // 添加图片到 PDF
}
}
}
} else {
is = new ByteArrayInputStream(ht.getBytes(StandardCharsets.UTF_8));
XMLWorkerHelper.getInstance().parseXHtml(writer, document, is, StandardCharsets.UTF_8, fontProvider);
}
} catch (DocumentException | IOException e) {
throw new RuntimeException("转换PDF失败: " + e.getMessage(), e);
} finally {
if (document.isOpen()) {
document.close(); // 确保Document关闭
}
if (fos != null) {
try {
fos.close(); // 关闭文件输出流
} catch (IOException e) {
e.printStackTrace();
}
}
if (is != null) {
try {
is.close(); // 关闭输入流
} catch (IOException e) {
e.printStackTrace();
}
}
}
MultipartFile multipartFile = getMultipartFile(pdfFile);
// 在此处删除创建的 PDF 文件
boolean deleted = pdfFile.delete();
if (!deleted) {
log.error("删除文件失败: " + pdfFile.getAbsolutePath());
}
return multipartFile;
}
private static MultipartFile getMultipartFile(File file) throws IOException {
try (FileInputStream fileInputStream = new FileInputStream(file)) {
return new MockMultipartFile(file.getName(), file.getName(), "application/pdf", fileInputStream);
}
}
public static String content2Html(String htmlContent) {
String COMPLETE_CONTENT = "<html><head></head><body style=\"font-family: SimSun;\">" + htmlContent + "</body></html>";
return COMPLETE_CONTENT.replace("<br>", "<br/>");
}
private static String replaceImgSrcWithBase64(String htmlContent) {
List<String> imgSrcs = new ArrayList<>();
String regex = "<img[^>]+src=\"([^\"]+)\"[^>]*>"; // 正确的正则表达式
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(htmlContent);
String baseUrl = "http://39.101.188.84:7071";
// 使用 StringBuilder 来构建新的 HTML
StringBuilder updatedHtml = new StringBuilder(htmlContent);
// 定义要替换的起始位置
int offset = 0;
while (matcher.find()) {
String imgSrc = matcher.group(1); // 捕获组返回 img src 的值
String imgUrl = baseUrl + imgSrc;
// 将 URL 转化为 Base64
try {
URL url = new URL(imgUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/5.0"); // 添加 User-Agent
connection.setDoInput(true);
connection.connect();
InputStream inputStream = connection.getInputStream();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
inputStream.close();
byte[] imageBytes = outputStream.toByteArray();
String base64 = Base64.getEncoder().encodeToString(imageBytes);
// 替换 img 标签的 src 属性为 Base64 数据
String base64ImgTag = "<img src=\"data:image/jpeg;base64," + base64 + "\" />";
int start = matcher.start() + offset; // 累计偏移量
int end = matcher.end();
// 替换原来的 img 标签
updatedHtml.replace(start, end, base64ImgTag);
//System.out.println(updatedHtml.toString());
// 更新偏移量
offset += base64ImgTag.length() - (end - start);
} catch (Exception e) {
e.printStackTrace();
return null; // 处理异常或返回特定的错误值
}
}
return updatedHtml.toString();
}
public String convertImageToBase64(String imgUrl) {
try {
// String encodedImgUrl = URLEncoder.encode(imgUrl, StandardCharsets.UTF_8.toString());
URL url = new URL(imgUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/5.0"); // 添加 User-Agent
connection.setDoInput(true);
connection.connect();
InputStream inputStream = connection.getInputStream();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
inputStream.close();
byte[] imageBytes = outputStream.toByteArray();
String base64 = Base64.getEncoder().encodeToString(imageBytes);
return "data:image/jpeg;base64," + base64; // 根据实际情况修改 MIME 类型
} catch (Exception e) {
e.printStackTrace();
return null; // 处理异常或返回特定的错误值
}
}
private static void clearTemporaryDirectory(Path directory) {
File dir = directory.toFile();
if (dir.exists() && dir.isDirectory()) {
for (File file : dir.listFiles()) {
if (!file.isDirectory()) {
file.delete(); // 删除文件
}
}
}
}
}

@ -0,0 +1,55 @@
package com.ruoyi.gysl.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
public class ImgBase64Extractor {
public static void main(String[] args) throws IOException {
String imgUrl ="http://39.101.188.84:7071/profile/upload/2025/03/24/abc_20250324154129A006.jpg";
URL url = new URL(imgUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setDoInput(true);
// 添加请求头
connection.setRequestProperty("User-Agent", "Mozilla/5.0");
connection.setRequestProperty("Accept", "image/webp,image/apng,image/*,*/*;q=0.8");
connection.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
// 连接并获取响应
connection.connect();
// 检查响应码
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
// 连接成功,获取输入流
InputStream inputStream = connection.getInputStream();
// 读取输入流
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
inputStream.close();
byte[] imageBytes = outputStream.toByteArray();
System.out.println(imageBytes);
} else {
System.out.println("Error: Server returned HTTP response code: " + responseCode);
}
}
}

@ -0,0 +1,168 @@
package com.ruoyi.gysl.utils;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.tool.xml.XMLWorkerFontProvider;
import com.itextpdf.tool.xml.XMLWorkerHelper;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Date;
public class PdfUtils {
// 定义全局的字体静态变量
private static Font titlefont;
private static Font headfont;
private static Font keyfont;
private static Font textfont;
// 最大宽度
private static int maxWidth = 520;
// 静态代码块
static {
try {
// 不同字体这里定义为同一种字体包含不同字号、不同style
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
titlefont = new Font(bfChinese, 16, Font.BOLD);
headfont = new Font(bfChinese, 14, Font.BOLD);
keyfont = new Font(bfChinese, 10, Font.BOLD);
textfont = new Font(bfChinese, 10, Font.NORMAL);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* htmlpdf
*
* @param htmlContent
* @throws Exception
*/
public MultipartFile html2Pdf(String htmlArticleTitle, String htmlContent) throws Exception {
htmlContent = this.content2Html(htmlContent);
String path = System.getProperty("user.dir");
//根据日期建文件夹
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String format = formatter.format(date);
String[] split = format.split("-");
File dir = new File(path + "/temporary");
if (!dir.exists()) {
dir.mkdir();
}
File dir2 = new File(path + "/temporary" + "/" + split[0]);
if (!dir2.exists()) {
dir2.mkdir();
}
File dir3 = new File(path + "/temporary" + "/" + split[0] + "/" + split[1]);
if (!dir3.exists()) {
dir3.mkdir();
}
File dir4 = new File(path + "/temporary" + "/" + split[0] + "/" + split[1] + "/" + split[2]);
if (!dir4.exists()) {
dir4.mkdir();
}
File pdfFile = new File(dir4 + "/pdf" + "-" + System.currentTimeMillis() + ".pdf");
//1 打开文件流
Document document = new Document();
FileOutputStream fos = new FileOutputStream(pdfFile);
System.out.println(pdfFile);
InputStream is = new ByteArrayInputStream(htmlContent.getBytes(StandardCharsets.UTF_8));
//InputStream cssIs = new ByteArrayInputStream(getCssFile());
PdfWriter writer = null;
try {
writer = PdfWriter.getInstance(document, fos);
//3. 设置字体
XMLWorkerFontProvider fontProvider1 = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS);
//fontProvider1.register(path+"\\simsun.ttc");//本地
fontProvider1.register(path + "/simsun.ttc");//部署服务器
//3 打开文档
document.open();
// 段落
Paragraph paragraph = new Paragraph(htmlArticleTitle, titlefont);
paragraph.setAlignment(1); //设置文字居中 0靠左 1居中 2靠右
paragraph.setIndentationLeft(12); //设置左缩进
paragraph.setIndentationRight(12); //设置右缩进
paragraph.setFirstLineIndent(24); //设置首行缩进
paragraph.setLeading(20f); //行间距
paragraph.setSpacingBefore(5f); //设置段落上空白
paragraph.setSpacingAfter(10f); //设置段落下空白
document.add(paragraph);
//4 html转为pdf
//XMLWorkerHelper.getInstance().parseXHtml(writer, document, is, cssIs, Charset.forName("UTF-8"), fontProvider1);
XMLWorkerHelper.getInstance().parseXHtml(writer, document, is, StandardCharsets.UTF_8, fontProvider1);
} catch (DocumentException | IOException e) {
throw new RuntimeException("转pdf失败罗~");
} finally {
if (null != writer) {
writer.flush();
}
//5 关闭文档
document.close();
fos.close();
//cssIs.close();
is.close();
writer.close();
MultipartFile multipartFile = getMulipartFiles2(pdfFile + "");
System.out.println("pdfFile = " + pdfFile);
return multipartFile;
}
}
public MultipartFile getMulipartFiles2(String filePath) throws IOException {
File file = new File(filePath);
FileInputStream fileInputStream = new FileInputStream(file);
MultipartFile multipartFile = new MockMultipartFile(file.getName(), file.getName(),
"application/sql", fileInputStream);
long size = multipartFile.getSize();
return multipartFile;
}
/**
* html
*
* @return
*/
public String content2Html(String htmlContent) {
String COMPLETE_CONTENT = "<html><head></head><body style=\"font-family: SimSun;\">" + htmlContent + "</body></html>";
String content = COMPLETE_CONTENT;
content = content.replace("<br>", "<br/>");
return content;
}
/**
*
*
* @return
* @throws Exception
*/
protected byte[] getCssFile() throws Exception {
FileInputStream fileInputStream = new FileInputStream("D:\\editor.css");
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1204];
int len = 0;
while ((len = fileInputStream.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
}
fileInputStream.close();
return outStream.toByteArray();
}
}

@ -2,8 +2,6 @@ package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
@ -37,21 +35,6 @@ public class SysLogininforController extends BaseController
@Autowired
private SysPasswordService passwordService;
/**
* 访
*/
@PreAuthorize("@ss.hasAnyRoles('admin,common,gov,company')")
@GetMapping("/getNewSysLogininfor")
public AjaxResult getNewSysLogininfor() {
String str = null;
try {
str = SecurityUtils.getUsername();
} catch (Exception ignored) {
}
return success(logininforService.getNewSysLogininfor(str));
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)

@ -11,19 +11,19 @@ import com.ruoyi.common.utils.StringUtils;
*
* @author ruoyi
*/
//@RestController
//public class SysIndexController
//{
@RestController
public class SysIndexController
{
/** 系统基础配置 */
// @Autowired
// private RuoYiConfig ruoyiConfig;
@Autowired
private RuoYiConfig ruoyiConfig;
// /**
// * 访问首页,提示语
// */
// @RequestMapping("/")
// public String index()
// {
// return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
// }
//}
/**
* 访
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
}
}

@ -53,7 +53,7 @@ public class SwaggerConfig
// 是否启用Swagger
.enable(enabled)
//分组名称
.groupName("工业上楼")
.groupName("太仓资产核查")
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示

@ -1,7 +1,3 @@
# 项目相关配置
ruoyi:
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: /home/ruoyi/uploadPath
# 数据源配置
spring:
datasource:
@ -10,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://36.213.9.3:3307/gysl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://39.101.188.84:3307/gysl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Jichuang@250603
password: Admin123@
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -63,20 +59,3 @@ spring:
wall:
config:
multi-statement-allow: true
# 是否是正式环境
isZs: false
#企业端单点登陆url
url: http://114.216.202.175:8008/api/usercenter/User/ssoLogin
#企业端用户信息url
infoUrl: http://114.216.202.175:8008/api/usercenter/User/getInfo
#企业端退出登录url
logoutUrl: http://114.216.202.175:8008/api/usercenter/User/ssoLogOut
#企业端正式环境应用系统编号
enterpriseAppId: 193d64ab-316e-11f0-b7ab-9c5c8e847e61
# 应用私钥
enterpriseAppsecret: 7C21B5B9316E11F0B7AB9C5C8E847E61
#自己客户端地址
#returnUrl: http://192.168.0.119:80
returnUrl: http://36.213.9.3:81/gysl/index.html

@ -1,31 +1,3 @@
# 项目相关配置
ruoyi:
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: /home/ruoyi/uploadPath
# 正式环境配置
server:
# 服务器的HTTP端口默认为8080
port: 7071
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: error
org.springframework: error
# 数据源配置
spring:
datasource:
@ -34,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.114.0.18:3306/gysl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://39.101.188.84:3307/gysl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: GyslMysql@1234
password: Admin123@
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -87,45 +59,3 @@ spring:
wall:
config:
multi-statement-allow: true
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: GyslRedis@1234
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# Swagger配置
swagger:
# 是否开启swagger
enabled: false
# 请求前缀
pathMapping: /
# 是否是正式环境
isZs: true
#企业端单点登陆url
url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin
#企业端用户信息url
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
#企业端退出登录url
logoutUrl: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogOut
#企业端正式环境应用系统编号
enterpriseAppId: 193d64ab-316e-11f0-b7ab-9c5c8e847e61
# 应用私钥
enterpriseAppsecret: 7C21B5B9316E11F0B7AB9C5C8E847E61
#自己客户端地址
returnUrl: https://gysl.sipac.gov.cn

@ -1,89 +0,0 @@
# 项目相关配置
ruoyi:
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://36.213.9.3:3307/gysl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Jichuang@250603
# 从库数据源
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
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 密码
password:
# 是否是正式环境
isZs: false
#企业端单点登陆url
url: http://114.216.202.175:8008/api/usercenter/User/ssoLogin
#企业端用户信息url
infoUrl: http://114.216.202.175:8008/api/usercenter/User/getInfo
#企业端退出登录url
logoutUrl: http://114.216.202.175:8008/api/usercenter/User/ssoLogOut
#企业端正式环境应用系统编号
enterpriseAppId: 193d64ab-316e-11f0-b7ab-9c5c8e847e61
# 应用私钥
enterpriseAppsecret: 7C21B5B9316E11F0B7AB9C5C8E847E61
#自己客户端地址
#returnUrl: http://192.168.0.119:80
returnUrl: http://36.213.9.3:81/gysl/index.html

@ -1,9 +1,9 @@
# 项目相关配置
ruoyi:
# 名称
name: gysl
name: RuoYi
# 版本
version: 0.8.1
version: 3.8.9
# 版权年份
copyrightYear: 2025
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
@ -41,9 +41,9 @@ logging:
user:
password:
# 密码最大错误次数
maxRetryCount: 6
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 30
lockTime: 10
# Spring配置
spring:
@ -70,11 +70,11 @@ spring:
# 地址
host: localhost
# 端口默认为6379
port: 6380
port: 6379
# 数据库索引
database: 0
# 密码
password: Jichuang@250604
password:
# 连接超时时间
timeout: 10s
lettuce:
@ -127,22 +127,3 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# 是否是正式环境
isZs: false
#政务端clientId
clientId: 9911336a2b67451fb9e1d78131c0e5e9
#政务端clientSecret
clientSecret: fXckuZrxMdh6nl/ISI2WTg==
#政务端appkey
appkey: db90cb33-6551-4d1f-875e-236d66af4fcc
#政务端经济大脑(政务端)获取用户信息接口
getInfoId: https://172.21.10.12/enterprise-gateway/sipsg-enterprise/sys/third/userInfo
#政务端政务通获取用户信息接口(可选)
getAllInfo: http://172.21.10.14/open/api/identity/data/FindUserById
sm4: ef5323158e0d43e69442718cd4932116
sm2: MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgefIcY79Be48T8ryF9tMOKDFZ4XmeB9JzBSmEZHGmvhKhRANCAAQmjPisOvJfv2r7mpj06FszOkAlJiyVL6OoefMmXmqSANNqyT8ZxnFpnToYgtqjQqX44IG8fXk49eLjKXQSfJ2J
accessId: d8bc5ba2-7114-46aa-b4e0-141804e4df1c
sceneId: 202505210001
dataUrl: http://172.21.10.46/api/invoke/323018/

@ -336,9 +336,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="req.isFmqd != null">
AND a.is_fmqd = #{req.isFmqd}
</if>
<if test="req.status != null">
AND a.status = #{req.status}
</if>
</where>
order by create_time desc
</select>
@ -367,7 +364,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="prioritize" column="prioritize"/>
<result property="ssgnq" column="ssgnq"/>
<result property="jsms" column="jsms"/>
<result property="fj" column="fj"/>
</resultMap>
<resultMap type="com.ruoyi.gysl.entity.PlanInformation" id="PlanInfor">
<result property="id" column="id"/>
@ -391,7 +387,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="idListToProject" resultMap="BasicInformationResponseMap">
SELECT a.*,b.*,
c.id
c.*
FROM gysl_basic_information a
left join gysl_plan_information b on a.id = b.xm_id
left join gysl_building_information c on a.id = c.xm_id
@ -403,9 +399,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</where>
group by a.id,a.name,a.ztze,a.label,a.xzfl,a.prioritize,a.ssgnq,a.jsms,a.fj,
b.id,b.zjzmj,b.zydmj,b.bzcjzmj,b.zgjzgd,b.jzds,b.zgjzcs,b.fhdj,b.jdctcw,b.fjdctcw,
c.id
order by a.create_time desc
</select>

@ -5,11 +5,14 @@
<select id="page" resultType="com.ruoyi.gysl.entity.Cybq">
select * from gysl_cybq
<where>
<if test="req.catalogueid != null and req.catalogueid != '' ">
AND catalogueid = #{req.catalogueid}
<if test="req.bqdm != null and req.bqdm != '' ">
AND bqdm = #{req.bqdm}
</if>
<if test="req.status != null and req.status != ''">
AND status = #{req.status}
<if test="req.bqzt != null and req.bqzt != ''">
AND bqzt = #{req.bqzt}
</if>
<if test="req.yhlx != null and req.yhlx != ''">
AND yhlx = #{req.yhlx}
</if>
</where>
</select>

@ -2,32 +2,5 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.gysl.mapper.ProjectHandBookMapper">
<select id="page" resultType="com.ruoyi.gysl.entity.GyslProjectHandbook">
select * from gysl_project_handbook
<where>
<if test="req.name != null and req.name != '' ">
AND name like concat('%',#{req.name},'%')
</if>
<if test="req.startTime != null">
AND create_time &gt;= #{req.startTime} <!-- 大于等于 -->
</if>
<if test="req.endTime != null">
AND create_time &lt;= #{req.endTime} <!-- 小于等于 -->
</if>
</where>
</select>
<select id="getProjectName" resultType="com.ruoyi.gysl.entity.BasicInformation">
SELECT a.*
FROM gysl_basic_information a
<where>
<if test="id != null">
and a.id in
<foreach collection="id" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

@ -1,15 +1,6 @@
<?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.docking.mapper.ProjectMapper">
<update id="editProject" parameterType="BasicInformation">
update gysl_basic_information set project_id = #{req.projectId}
where id = #{req.id}
</update>
<select id="page" resultType="com.ruoyi.docking.entity.Project">
SELECT
b.*
FROM project b
where b.project_name like concat('%',#{name},'%')
</select>
</mapper>

@ -7,16 +7,8 @@
FROM
project_progress a
LEFT JOIN project b ON a.project_id = b.project_id
where b.project_id = #{projectId}
order by a.month asc
</select>
<select id="getXmId" resultType="com.ruoyi.docking.entity.ProjectProgress">
SELECT
*
FROM
project_progress a
where a.xm_id = #{id}
order by a.month asc
LEFT JOIN gysl_basic_information c ON b.company_id = c.tyshxydm
where c.id = #{req.xmId}
</select>
</mapper>

@ -8,9 +8,6 @@
IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1,
IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2,
IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,
IFNULL(SUM(a.ztze), 0) AS allInvest1,
IFNULL(SUM(a.jhtze), 0) AS allInvest2,
IFNULL(SUM(b.zydmj), 0) AS allInvest3,
<!-- 当前新开工项目数 -->
IFNULL(SUM(
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN 1 ELSE 0 END
@ -30,22 +27,13 @@
<!-- 当年_拟建数量 -->
IFNULL(SUM(
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) and a.xzfl = 3 THEN 1 ELSE 0 END
), 0) AS currentBuilding3,
<!-- 当年_总投资额 -->
IFNULL(SUM(
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN a.ztze ELSE 0 END
), 0) AS currentAllInvest1,
<!-- 当年_计划投资额 -->
IFNULL(SUM(
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN a.jhtze ELSE 0 END
), 0) AS currentAllInvest2,
<!-- 当年_占地面积 -->
IFNULL(SUM(
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN b.zydmj ELSE 0 END
), 0) AS currentAllInvest3
), 0) AS currentBuilding3
FROM gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
where a.tyshxydm = #{userName}
</select>
<select id="relationalProject" resultType="com.ruoyi.gysl.entity.BasicInformation">
</select>
<select id="qyNotice" resultType="com.ruoyi.docking.entity.SmartDeclaration">
select * from gysl_smart_declaration

@ -9,7 +9,7 @@
from gysl_smart_reminders a
<where>
<if test="req.rulesName != null and req.rulesName != '' ">
and a.rules_name like concat('%',#{req.rulesName},'%')
and a.rules_name = #{req.rulesName}
</if>
<if test="req.alertType != null and req.alertType != '' ">
and a.alert_type = #{req.alertType}

@ -73,18 +73,7 @@
AND a.end_time = #{req.endTime}
</if>
</where>
group by a.id,
a.name,
a.begain_time,
a.end_time,
a.xzfl,
a.xmfrdwxz,
a.ztze,
b.floor,
b.scgd,
b.two_and_four_cg ,
b.scdmhz,
b.two_and_three_lmhz
group by a.id
<if test="req.pjdj == 2 and req.sort == 1">
order by a.ztze asc
</if>

@ -8,9 +8,6 @@
IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1,
IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2,
IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,
IFNULL(SUM(a.ztze), 0) AS allInvest1,
IFNULL(SUM(a.jhtze), 0) AS allInvest2,
IFNULL(SUM(b.zydmj), 0) AS allInvest3,
<!-- 当前新开工项目数 -->
IFNULL(SUM(
<choose>
@ -65,41 +62,7 @@
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) and a.xzfl = 3 THEN 1 ELSE 0 END
</otherwise>
</choose>
), 0) AS currentBuilding3,
<!-- 当年_总投资额 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} THEN a.ztze ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN a.ztze ELSE 0 END
</otherwise>
</choose>
), 0) AS currentAllInvest1,
<!-- 当年_计划投资额 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} THEN a.jhtze ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN a.jhtze ELSE 0 END
</otherwise>
</choose>
), 0) AS currentAllInvest2,
<!-- 当年_占地面积 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} THEN b.zydmj ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN b.zydmj ELSE 0 END
</otherwise>
</choose>
), 0) AS currentAllInvest3
), 0) AS currentBuilding3
FROM gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
<where>
@ -149,12 +112,12 @@
where zw_id = #{userId} and is_read = 1
</select>
<select id="xfcyfx" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT COUNT(a.xfcy) AS count,
SELECT COUNT(a.cylb) AS count,
b.dict_label AS ssgnq
FROM
( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cylb' ) b
LEFT JOIN (select * from gysl_basic_information where status = 3 ) a
ON a.xfcy = b.dict_value
LEFT JOIN gysl_xfcygl a
ON a.cylb = b.dict_value
GROUP BY
b.dict_label,
b.dict_value
@ -162,12 +125,12 @@
b.dict_value;
</select>
<select id="mlfx" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT COUNT(a.ml) AS count,
SELECT COUNT(a.slmllb) AS count,
b.dict_label AS ssgnq
FROM
( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'shangloumulu' ) b
LEFT JOIN (select * from gysl_basic_information where status = 3 ) a
ON a.ml = b.dict_value
LEFT JOIN gysl_ml a
ON a.slmllb = b.dict_value
GROUP BY
b.dict_label,
b.dict_value
@ -188,17 +151,5 @@
LEFT JOIN gysl_ml a
ON a.slmllb = b.dict_value
</select>
<select id="cbxmtj" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT
count(*) AS count,
jsms AS ssgnq
FROM
gysl_basic_information
WHERE
status = 3 and jsms is not null
GROUP BY
jsms
</select>
</mapper>

@ -1,45 +0,0 @@
package com.ruoyi.common.utils;
import javax.crypto.Cipher;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
/**
* RSA
*
* @author ruoyi
**/
public class RsaUtils
{
// Rsa 私钥
private static final String PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXxtLWRhOIyEhLkxlTbndtzS6RrGsDWV8LOIAEXFCsLZzT20ytAaO4fpXXHah80EwaE4P25Y3+qQBDL8fA5780pSoLDo3Si/qC5KuowNb8F1ncGXSuYzX/3mNMLXF98UW96PvFY198hto8j5snhYtf01WI2L0eZPQFE3Mnh3ZHzos88Jr5vEto+OyHZHa0GRsuRSi33vr1olo8+LA8JkcyS5B6eMdKalYvSiSV6owfwQZfuPoDkD/ghRc8w0owzOSJJGmwgnrkYmYMBudHdldF8LwzNUEEkHrOvk3QXg33Fl8X4lL9jHvbq0K76sDoYMLJPG1D/Ccqk93AU/mdRYJZAgMBAAECggEAG+w3M7aWt25pZoX8fc3v6OJ7s88trOMPSkgtvR+is9p8ZLmOxLFthm67cGUDb1r+9Tkr6QtYcUZ0RugObt3z3mKYdopJ6zdXcidRsW0w4BYHsSd5wO99qsImMIiXvZzawNKRJ0Jd+dHxanzdBYtbFdkSfmepe2MFRb3LTLVuPE1oCTKbzwqPSGWERpkejZJz+Cthc/xp7PWNFtfmEASEuAmYV0tdWC0H6NJqTtg2Stotp4hlk/jTKLoYQW/m3pmnkw1QbVRh1B9mtxTVtGV6HzhiQbuc5HWaUvBm4ysiXjFEtCTpBeDjwvnD1wkDXR1SyVdYiAfDYM2zCCs5OvWPFQKBgQD3MONf6Jn7x6Xo2uwsKwca4HFkfIHpK5TdiFB9p2eCZ4V8JZNPv02fPRldFb56nYVmdNVoo8/z4WG9t6uNoTLDMqTI0wVkrJCufQCI/50XnKITEmLfXOKXkwhekRLi1oho0nEsbaQllFFrlfx4NkcgoW6XL1TW8eRx8JD7EORI9wKBgQCdL3mZ5gumLLhB/RTK5G786jJtztNxQ4jpFtClv25uPJgqsRgSVoLnnTCmLm/yGsHNna/CHbA4mYOYzXiM10WUK1tEqPwYm0nalQAxtXJjNgERKjWWaopZW/f4pCBPV8RG4dk/+13zjPCYTeS4i7J89psHljqoeQoLe4xazLKLLwKBgHgV+f/34gadIQ6UfDOg25zE+JFWo04BbBqLRH8munRxkjmTj5MoXq9DYXUFQToUGGCD1cE2A6p5DaC6/86YRy7pBYDCc1ZLNyZtd7sWYty7rUkSn5Hfb/0u4tv+ImysyCwUQALTaPEQstVPUg2cYMWLZ0xvJAogDVkFA4nU1PJVAoGAEBQ7LDMMHgOVFar95YNYlyad4f22Q2/VIYLj9RCQC1bHehaDj9ypp2e9AkLd0LZL/OyUfhbrX97UR109Z6rdwzpsK6ndn+bCt0lmq68T9HIhyc+3i5t6a4ms5BJl+7fOrDGON61O/wr70ZimPPqNV5siYLRNa8516JbK1L77xKECgYEAyaTui+7B27219nwgoin9AuM0H7B+rzz0GkXmYXzWhxgKB+eBuJbZsrUTOBVkk66j3Ss4cJvQJ9utcFBnS6msEAUCYU6OuInIb/PMv8I7DC7SrrTZpyD9LXKIB4aYtqPrntZSo+75EAHgXNpRYqUwkpZbCuYSIXebno4JOxB1RK8=" +
"CfhCau4K5xqFfYnCDxwN6EfWtl118/RC/H1G6YUH9VZ02hTsIKtcdoz/w3knVDuL/i1uCtKtJDdyejF8osix2IVVA2HNoUPEG+3VH0IJjOoFTZTP76LcuQvgig6pjAtB5+GFPVkkrdxWZc3rn+psCdzYBueVhDRDFatKxfvAQMk90SMNVOLApB8u4aWUdxGju3vOKO5ShBUVutyczTzAOW39hHdzXX5CvGPXNYNv7S55AVAI5ZVdn11dyxgPr6u7n7AuHtc2pvUddHTRM/UczNN5lkpdMvISQy4iHwCw9wGVax3kvRxMzhYiBricSKJWbl4LiAMRV3P15LWkaBwSkw==";
/**
*
*/
public static String decryptByPrivateKey(String decodeString) throws Exception {
// 将传入的Base64编码字符串解码为字节数组
byte[] encryptedBytes = java.util.Base64.getDecoder().decode(decodeString);
// 使用私钥解密
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(org.apache.commons.codec.binary.Base64.decodeBase64(PRIVATE_KEY));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
byte[] decryptedBytes = decrypt(encryptedBytes, privateKey);
// 返回解密后的字符串
return new String(decryptedBytes);
}
/**
*
*/
private static byte[] decrypt(byte[] data, PrivateKey privateKey) throws Exception {
// 获取RSA算法的Cipher实例
Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
// 用私钥初始化Cipher实例设置为解密模式
cipher.init(Cipher.DECRYPT_MODE, privateKey);
// 执行解密操作,返回解密后的字节数组
return cipher.doFinal(data);
}
}

@ -114,10 +114,7 @@ public class SecurityConfig
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
.antMatchers("/system/chief/**").permitAll()
.antMatchers("/system/singlelogin/**").permitAll()
// .antMatchers("/gysl/basicInformation/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/gysl/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

@ -10,7 +10,6 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.*;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.RsaUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.manager.AsyncManager;
@ -73,38 +72,32 @@ public class SysLoginService {
*/
public String login(String username, String password, String code, String uuid, Integer loginRole) {
// 验证码校验
// validateCaptcha(username, code, uuid);
validateCaptcha(username, code, uuid);
// 登录前置校验
String strP;
try {
strP = RsaUtils.decryptByPrivateKey(password);
} catch (Exception e) {
throw new RuntimeException(e);
}
loginPreCheck(username, strP);
loginPreCheck(username, password);
//判断当前登录用户名是否符合loginRole
List<String> role = sysUserMapper.selectRoleByUserName(username);
if (!role.isEmpty()) {
if (loginRole == null) {
throw new ServiceException("登录失败");
throw new ServiceException("无法登录!");
} else {
if (loginRole == 1) {
if (!CollectionUtils.containsAny(role, ZW_ROLES)) {
throw new ServiceException("登录失败");
throw new ServiceException("请登录企业用户!");
}
} else if (loginRole == 2) {
if (!CollectionUtils.containsAny(role, QY_ROLES)) {
throw new ServiceException("登录失败");
throw new ServiceException("请登录政务用户!");
}
}
}
} else {
throw new ServiceException("登录失败");
throw new ServiceException("暂无该用户!");
}
// 用户验证
Authentication authentication = null;
try {
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, strP);
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
AuthenticationContextHolder.setContext(authenticationToken);
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager.authenticate(authenticationToken);

@ -201,7 +201,7 @@ public class SysJobServiceImpl implements ISysJobService
@Transactional(rollbackFor = Exception.class)
public int insertJob(SysJob job) throws SchedulerException, TaskException
{
// job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
int rows = jobMapper.insertJob(job);
if (rows > 0)
{

@ -39,9 +39,4 @@ public interface SysLogininforMapper
* @return
*/
public int cleanLogininfor();
/**
* 访
*/
SysLogininfor getNewSysLogininfor(String str);
}

@ -37,9 +37,4 @@ public interface ISysLogininforService
*
*/
public void cleanLogininfor();
/**
* 访
*/
SysLogininfor getNewSysLogininfor(String str);
}

@ -1,8 +1,5 @@
package com.ruoyi.system.service.impl;
import java.time.LocalDateTime;
import java.time.Period;
import java.time.ZoneId;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -65,26 +62,4 @@ public class SysLogininforServiceImpl implements ISysLogininforService
{
logininforMapper.cleanLogininfor();
}
/**
* 访
*/
@Override
public SysLogininfor getNewSysLogininfor(String str) {
SysLogininfor ns = logininforMapper.getNewSysLogininfor(str);
if(ns!=null){
LocalDateTime ld = ns.getLoginTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
Period period = Period.between(ld.toLocalDate(), LocalDateTime.now().toLocalDate());
int days = period.getDays() + (period.getMonths() * 30) + (period.getYears() * 365);
if(days>=90){
return ns;
}else {
return null;
}
}else {
return null;
}
}
}

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

Loading…
Cancel
Save