mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 17:58:17 +08:00
对申报端进行加解密
This commit is contained in:
parent
a5c9b26571
commit
c947e30572
8
pom.xml
8
pom.xml
@ -355,6 +355,12 @@
|
||||
<version>${ruoyi-vue-plus.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-rsaencrypt</artifactId>
|
||||
<version>${ruoyi-vue-plus.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Sa-Token 插件:整合SSO -->
|
||||
<!--<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
@ -402,6 +408,8 @@
|
||||
<module>ruoyi-sms</module>
|
||||
<module>ruoyi-work</module>
|
||||
<module>ruoyi-file</module>
|
||||
<module>ruoyi-rsaencrypt</module>
|
||||
|
||||
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@ -94,6 +94,11 @@
|
||||
<artifactId>ruoyi-file</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-rsaencrypt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- skywalking 整合 logback -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.common;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.file.service.ISysFileService;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -30,6 +31,7 @@ public class SysFileController
|
||||
/*文件上传请求*/
|
||||
|
||||
|
||||
@RsaSecurityParameter
|
||||
@PostMapping("upload")
|
||||
public R<Map> upload(MultipartFile file)
|
||||
{
|
||||
|
||||
@ -3,23 +3,19 @@ package com.ruoyi.web.controller.house;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.ruoyi.system.domain.BuyHouses;
|
||||
import com.ruoyi.system.domain.bo.HousesReviewBo;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
||||
@ -47,6 +43,7 @@ public class BuyHousesController extends BaseController {
|
||||
@SaCheckPermission("system:houses:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BuyHousesVo> list(BuyHousesBo bo, PageQuery pageQuery) {
|
||||
bo.setProcessStatus(Constants.SUCCEED);
|
||||
return iBuyHousesService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@ -57,13 +54,13 @@ public class BuyHousesController extends BaseController {
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("/subscribeExport")
|
||||
public R subscribeExport(BuyHousesBo bo) throws IOException {
|
||||
public R subscribeExport(@RequestBody BuyHousesEvent bo) throws IOException {
|
||||
return iBuyHousesService.subscribeExport(bo);
|
||||
}
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
@GetMapping("/exportExcel")
|
||||
@PostMapping("/exportExcel")
|
||||
public void exportExcel(BuyHousesBo bo,HttpServletResponse response){
|
||||
iBuyHousesService.exportExcel(bo,response);
|
||||
}
|
||||
@ -91,27 +88,6 @@ public class BuyHousesController extends BaseController {
|
||||
return R.ok(iBuyHousesService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
/*@SaCheckPermission("system:houses:add")
|
||||
@Log(title = "【购房申请添加】", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BuyHousesBo bo) {
|
||||
return toAjax(iBuyHousesService.insertByBo(bo));
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
/* @SaCheckPermission("system:houses:edit")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BuyHousesBo bo) {
|
||||
return toAjax(iBuyHousesService.updateByBo(bo));
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
@ -13,10 +14,12 @@ import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.excel.ExcelResult;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.BuyHouses;
|
||||
import com.ruoyi.system.domain.HousesReview;
|
||||
import com.ruoyi.system.domain.bo.HousesReviewBo;
|
||||
import com.ruoyi.system.domain.dto.HousesReviewEvent;
|
||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||
import com.ruoyi.system.mapper.BuyHousesMapper;
|
||||
import com.ruoyi.system.service.IHousesReviewService;
|
||||
@ -63,6 +66,19 @@ public class HousesReviewController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 购房登记录入管理列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("system:manager:reviewList")
|
||||
@GetMapping("/manager/list")
|
||||
public TableDataInfo<HousesReview> managerReviewList(HousesReviewBo bo, PageQuery pageQuery) {
|
||||
bo.setProcessStatus(Constants.SUCCEED);
|
||||
return iHousesReviewService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约导出
|
||||
* @param bo
|
||||
@ -70,14 +86,14 @@ public class HousesReviewController extends BaseController {
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("/subscribeExport")
|
||||
public R subscribeExport(HousesReviewBo bo) throws IOException {
|
||||
public R subscribeExport(HousesReviewEvent bo) throws IOException {
|
||||
return iHousesReviewService.subscribeExport(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
@GetMapping("/exportExcel")
|
||||
@PostMapping("/exportExcel")
|
||||
public void exportExcel(HousesReviewBo bo,HttpServletResponse response){
|
||||
iHousesReviewService.exportExcel(bo,response);
|
||||
}
|
||||
@ -88,6 +104,10 @@ public class HousesReviewController extends BaseController {
|
||||
@SaCheckPermission("system:review:list")
|
||||
@GetMapping("/registrationManagement/list")
|
||||
public TableDataInfo<HousesReview> list(HousesReviewBo bo, PageQuery pageQuery) {
|
||||
boolean admin = LoginHelper.isAdmin();
|
||||
if (!admin){
|
||||
bo.setProjectName(LoginHelper.getUsername());
|
||||
}
|
||||
return iHousesReviewService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@ -107,7 +127,7 @@ public class HousesReviewController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("system:review:query")
|
||||
@SaCheckPermission("system:review:edit")
|
||||
@GetMapping("/registrationManagement/{id}")
|
||||
public R<HousesReviewVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@ -140,7 +160,7 @@ public class HousesReviewController extends BaseController {
|
||||
* 删除购房复审登记
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("system:review:remove")
|
||||
@SaCheckPermission("system:review:edit")
|
||||
@Log(title = "购房复审登记", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/registrationManagement/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@ -170,7 +190,7 @@ public class HousesReviewController extends BaseController {
|
||||
List<String> collect1 = buyHousesMapper.selectList(queryWrapper).stream().map(BuyHouses::getCardId).collect(Collectors.toList());
|
||||
for (HousesReview housesReview : list) {
|
||||
housesReview.setProcessKey("house_review");
|
||||
housesReview.setProcessStatus("submit");
|
||||
housesReview.setProcessStatus(Constants.SUBMIT);
|
||||
if ( collect1.size() > 0 && collect1.contains(housesReview.getCard()) ) {
|
||||
housesReview.setSourceBy("1");
|
||||
} else {
|
||||
@ -208,7 +228,4 @@ public class HousesReviewController extends BaseController {
|
||||
public R<?> getMaterialByBusinessId(@PathVariable(value = "id") Long id){
|
||||
return iHousesReviewService.getMaterialByBusinessId(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -16,9 +16,9 @@ import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.StrUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import com.ruoyi.sms.core.SmsTemplate;
|
||||
import com.ruoyi.sms.entity.SmsResult;
|
||||
import com.ruoyi.system.domain.BuyHouses;
|
||||
import com.ruoyi.system.domain.vo.RouterVo;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
@ -106,6 +106,7 @@ public class SysLoginController {
|
||||
* 退出登录
|
||||
*/
|
||||
@SaIgnore
|
||||
@RsaSecurityParameter
|
||||
@PostMapping("/logout")
|
||||
public R<Void> logout() {
|
||||
loginService.logout();
|
||||
@ -147,19 +148,24 @@ public class SysLoginController {
|
||||
*/
|
||||
@SaIgnore
|
||||
@RateLimiter(count = 2, time = 10)
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
@PostMapping("/userLogin")
|
||||
public R<Map<String, Object>> userLogin(
|
||||
public R userLogin(
|
||||
@Validated({LoginBody.passwordLogin.class})
|
||||
@RequestBody LoginBody loginBody) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
// 生成令牌
|
||||
String token = loginService.userLogin(loginBody.getUsername(), loginBody.getPassword());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return R.ok(ajax);
|
||||
return R.ok("登录成功",loginService.userLogin(loginBody.getUsername(), loginBody.getPassword()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号登录
|
||||
* @param loginBody
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
// @RateLimiter(count = 2, time = 10)
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
@PostMapping("/userSmsLogin")
|
||||
public R<Map<String, Object>> userSmsLogin(@Validated(LoginBody.smgLogin.class) @RequestBody LoginBody loginBody) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -176,6 +182,7 @@ public class SysLoginController {
|
||||
*/
|
||||
@SaIgnore
|
||||
@RateLimiter(count = 1, time = 10)
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
@PostMapping("/userUpdatePwd")
|
||||
public R<?> userUpdatePwd(@Validated(LoginBody.forgetPasswordLogin.class) @RequestBody LoginBody loginBody) {
|
||||
return loginService.userUpdatePwd(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode());
|
||||
@ -189,6 +196,7 @@ public class SysLoginController {
|
||||
@SaIgnore
|
||||
@RateLimiter(count = 1, time = 10)
|
||||
@PostMapping("/userRegister")
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R<?> userRegister(@Validated(LoginBody.registerUser.class) @RequestBody LoginBody loginBody) {
|
||||
return loginService.userRegister(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode());
|
||||
}
|
||||
@ -200,6 +208,7 @@ public class SysLoginController {
|
||||
*/
|
||||
// @RateLimiter(count = 1)
|
||||
@SaIgnore
|
||||
@RsaSecurityParameter()
|
||||
@GetMapping("/forgotSendAliYun")
|
||||
public R<?> forgotSendAliYun(String phones) {
|
||||
boolean matches = phones.matches("^1(3\\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||
@ -216,6 +225,7 @@ public class SysLoginController {
|
||||
*/
|
||||
// @RateLimiter(count = 1,time = 20)
|
||||
@SaIgnore
|
||||
@RsaSecurityParameter
|
||||
@GetMapping("/registerSendAliYun")
|
||||
public R<?> registerSendAliYun(String phones) {
|
||||
boolean matches = phones.matches("^1(3\\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||
@ -233,6 +243,7 @@ public class SysLoginController {
|
||||
// @RateLimiter(count = 1,time = 20)
|
||||
@SaIgnore
|
||||
@GetMapping("/smsLoginSendAliYun")
|
||||
@RsaSecurityParameter
|
||||
public R<?> smsLoginSendAliYun(String phones) {
|
||||
boolean matches = phones.matches("^1(3\\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||
if (!matches) {
|
||||
|
||||
@ -13,6 +13,7 @@ import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.DownloadGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import com.ruoyi.system.domain.BuyHouses;
|
||||
import com.ruoyi.system.domain.bo.BuyHousesBo;
|
||||
import com.ruoyi.system.service.IBuyHousesService;
|
||||
@ -36,19 +37,21 @@ public class HouseController extends BaseController {
|
||||
/**
|
||||
* 购房申请添加
|
||||
*/
|
||||
@Log(title = "【购房申请添加】", businessType = BusinessType.INSERT)
|
||||
/* @Log(title = "【购房申请添加】", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BuyHousesBo bo) {
|
||||
return toAjax(iBuyHousesService.insertByBo(bo));
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 购房申请修改
|
||||
*/
|
||||
@Log(title = "【购房申请修改】", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@PostMapping()
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BuyHousesBo bo) {
|
||||
return toAjax(iBuyHousesService.updateByBo(bo));
|
||||
}
|
||||
@ -58,7 +61,8 @@ public class HouseController extends BaseController {
|
||||
*/
|
||||
@Log(title = "【购房获取详情】", businessType = BusinessType.OTHER)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("info")
|
||||
@PostMapping("/info")
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R<?> getInfo(@RequestBody BuyHouses buyHouses) {
|
||||
return iBuyHousesService.getInfo(buyHouses);
|
||||
}
|
||||
@ -68,15 +72,26 @@ public class HouseController extends BaseController {
|
||||
* 下载人才认定申请表
|
||||
*/
|
||||
@PostMapping("/download")
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R downloadWord(@Validated(DownloadGroup.class) @RequestBody BuyHousesBo buyHousesBo){
|
||||
return iBuyHousesService.downloadWord(buyHousesBo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载认定通知单
|
||||
*/
|
||||
@GetMapping("/downloadInform")
|
||||
@RsaSecurityParameter
|
||||
public R downloadInform(){
|
||||
return iBuyHousesService.downloadInform();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程进度列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/declareList")
|
||||
@RsaSecurityParameter
|
||||
public R getDeclareList(){
|
||||
return R.ok(iBuyHousesService.getDeclareList());
|
||||
}
|
||||
@ -86,6 +101,7 @@ public class HouseController extends BaseController {
|
||||
* 通过调用高新人才判断该身份证是否具备人才资格
|
||||
*/
|
||||
@PostMapping("/CandidatesInfo")
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R getGaoXinCandidateInfoByCardId(@RequestBody BuyHouses buyHouses){
|
||||
String cardId = buyHouses.getCardId();
|
||||
if (ObjectUtil.isNull(cardId) || ObjectUtil.isEmpty(cardId)){
|
||||
@ -93,4 +109,19 @@ public class HouseController extends BaseController {
|
||||
}
|
||||
return iBuyHousesService.getGaoXinCandidateInfoByCardId(cardId);
|
||||
}
|
||||
@GetMapping("/checkStatus")
|
||||
@RsaSecurityParameter
|
||||
public R checkStatus(){
|
||||
return iBuyHousesService.checkStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核日志
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/buyHouseLogs")
|
||||
@RsaSecurityParameter
|
||||
public R getBuyHouseLog(){
|
||||
return iBuyHousesService.getBuyHousesLogsByUserId();
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import com.ruoyi.work.domain.ActProcess;
|
||||
import com.ruoyi.work.domain.HisProcess;
|
||||
import com.ruoyi.work.domain.TProcess;
|
||||
@ -128,6 +129,7 @@ public class UserController extends BaseController {
|
||||
*/
|
||||
@Log(title = "获取当前业务运行到那一步",businessType = BusinessType.OTHER)
|
||||
@PostMapping("/processPlan")
|
||||
@RsaSecurityParameter(inDecode = true)
|
||||
public R<?> processPlan(@RequestBody ActProcess actProcess){
|
||||
List<TProcess> tProcesses = processMapper.selectList(new LambdaQueryWrapper<TProcess>()
|
||||
.eq(TProcess::getProcessKey, actProcess.getProcessKey()));
|
||||
@ -140,10 +142,8 @@ public class UserController extends BaseController {
|
||||
processVo.setBusinessId(actProcess.getBusinessId());
|
||||
processVo.setParams(map);
|
||||
hashMap.put("status",map.get("processStatus"));
|
||||
// hashMap.put("cardId",map.get("cardId"));
|
||||
List<ProcessVoResultDto> processPlan= WorkComplyUtils.getProcessPlan(processVo);
|
||||
hashMap.put("list",processPlan);
|
||||
return R.ok(hashMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
ruoyi-admin/src/main/resources/404.jpg
Normal file
BIN
ruoyi-admin/src/main/resources/404.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@ -102,7 +102,8 @@ spring:
|
||||
spring:
|
||||
redis:
|
||||
# 地址
|
||||
host: 119.96.86.131
|
||||
# host: 119.96.86.131
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
@ -173,7 +174,7 @@ sms:
|
||||
# 本地文件存储
|
||||
file:
|
||||
domain: http://192.168.0.54:8080
|
||||
path: D:\\gaoxin\\images\\
|
||||
path: D:\\gaoxin\\images
|
||||
prefix: /images
|
||||
size: 10
|
||||
template: D:\\gaoxin\\file\\
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -73,33 +73,45 @@ public interface Constants {
|
||||
String TOKEN = "token";
|
||||
|
||||
/**
|
||||
* 审核等待中
|
||||
* 待提交
|
||||
*/
|
||||
String WAIT = "wait";
|
||||
String SUBMIT = "0";
|
||||
|
||||
/**
|
||||
* 审核成功
|
||||
* 审核等待中
|
||||
*/
|
||||
String SUCCEED = "succeed";
|
||||
String WAIT = "1";
|
||||
|
||||
/**
|
||||
* 审核失败
|
||||
*/
|
||||
String FAILD = "faild";
|
||||
String FAILD = "2";
|
||||
|
||||
|
||||
/**
|
||||
* 公式中
|
||||
*/
|
||||
String PUBLICS = "3";
|
||||
|
||||
/**
|
||||
* 公式失败
|
||||
*/
|
||||
String PUBLICSFail = "4";
|
||||
|
||||
/**
|
||||
* 审核成功
|
||||
*/
|
||||
String SUCCEED = "5";
|
||||
|
||||
/**
|
||||
* 取消资格
|
||||
*/
|
||||
String CANCEL = "6";
|
||||
|
||||
/**
|
||||
* 数据不存在
|
||||
*/
|
||||
String NONENTITY = "nonentity";
|
||||
/**
|
||||
* 待提交
|
||||
*/
|
||||
String SUBMIT = "submit";
|
||||
|
||||
/**
|
||||
* 公式中
|
||||
*/
|
||||
String PUBLICS = "publics";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
@ -39,6 +40,7 @@ public class BaseEntity implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
|
||||
@ -47,6 +47,9 @@ public class R<T> implements Serializable {
|
||||
public static <T> R<T> ok(String msg, T data) {
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
public static <T> R<T> ok(int code,String msg, T data) {
|
||||
return restResult(data, code, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail() {
|
||||
return restResult(null, FAIL, "操作失败");
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 多任务处理工具类
|
||||
* @Author WhHao
|
||||
* @Date 2022/8/10 16:04
|
||||
* @Return
|
||||
*/
|
||||
@Slf4j
|
||||
public class FutureUtil {
|
||||
|
||||
/**
|
||||
* cpu 核心数
|
||||
*/
|
||||
private static final int AVALIABLE_PROCESSORS = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
// 最大超时时间
|
||||
private static final int TIMEOUT_VALUE = 1500;
|
||||
// 时间单位
|
||||
private static final TimeUnit TIMEOUT_UNIT = TimeUnit.MILLISECONDS;
|
||||
|
||||
|
||||
/**
|
||||
* Singleton delay scheduler, used only for starting and * cancelling tasks.
|
||||
*/
|
||||
public static final class Delayer {
|
||||
|
||||
static final ScheduledThreadPoolExecutor delayer;
|
||||
|
||||
/**
|
||||
* 异常线程,不做请求处理,只抛出异常
|
||||
*/
|
||||
static {
|
||||
delayer = new ScheduledThreadPoolExecutor(1, new DaemonThreadFactory());
|
||||
delayer.setRemoveOnCancelPolicy(true);
|
||||
}
|
||||
|
||||
static ScheduledFuture<?> delay(Runnable command, long delay, TimeUnit unit) {
|
||||
return delayer.schedule(command, delay, unit);
|
||||
}
|
||||
|
||||
static final class DaemonThreadFactory implements ThreadFactory {
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread t = new Thread(r);
|
||||
t.setDaemon(true);
|
||||
t.setName("CompletableFutureScheduler");
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据服务器cpu自定义线程池
|
||||
*/
|
||||
private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
|
||||
AVALIABLE_PROCESSORS,
|
||||
3 * AVALIABLE_PROCESSORS,
|
||||
3,
|
||||
TimeUnit.SECONDS,
|
||||
new LinkedBlockingDeque<>(20),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy()
|
||||
);
|
||||
|
||||
/**
|
||||
* 有返回值的异步
|
||||
* @param supplier
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CompletableFuture<T> supplyAsync(Supplier<T> supplier){
|
||||
return supplyAsync(TIMEOUT_VALUE,TIMEOUT_UNIT,supplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* 有返回值的异步 - 可设置超时时间
|
||||
* @param timeout
|
||||
* @param unit
|
||||
* @param supplier
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CompletableFuture<T> supplyAsync(long timeout, TimeUnit unit,Supplier<T> supplier){
|
||||
return CompletableFuture.supplyAsync(supplier, threadPoolExecutor)
|
||||
.applyToEither(timeoutAfter(timeout,unit), Function.identity())
|
||||
.exceptionally(throwable -> {
|
||||
throwable.printStackTrace();
|
||||
log.error(throwable.getMessage());
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 无返回值的异步
|
||||
* @param runnable
|
||||
* @return
|
||||
*/
|
||||
public static CompletableFuture runAsync(Runnable runnable){
|
||||
return runAsync(TIMEOUT_VALUE,TIMEOUT_UNIT,runnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无返回值的异步 - 可设置超时时间
|
||||
* @param runnable
|
||||
* @return
|
||||
*/
|
||||
public static CompletableFuture runAsync(long timeout, TimeUnit unit,Runnable runnable){
|
||||
return CompletableFuture.runAsync(runnable,threadPoolExecutor)
|
||||
.applyToEither(timeoutAfter(timeout,unit), Function.identity())
|
||||
.exceptionally(throwable -> {
|
||||
throwable.printStackTrace();
|
||||
log.error(throwable.getMessage());
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一处理异步结果
|
||||
* @param futures
|
||||
* @return
|
||||
*/
|
||||
public static CompletableFuture allOf(CompletableFuture... futures){
|
||||
return allOf(TIMEOUT_VALUE,TIMEOUT_UNIT,futures);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一处理异步结果 - 可设置超时时间
|
||||
* @param futures
|
||||
* @return
|
||||
*/
|
||||
public static CompletableFuture allOf(long timeout, TimeUnit unit,CompletableFuture... futures){
|
||||
return CompletableFuture.allOf(futures)
|
||||
.applyToEither(timeoutAfter(timeout,unit), Function.identity())
|
||||
.exceptionally(throwable -> {
|
||||
throwable.printStackTrace();
|
||||
log.error(throwable.getMessage());
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步超时处理
|
||||
* @param timeout
|
||||
* @param unit
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CompletableFuture<T> timeoutAfter(long timeout, TimeUnit unit) {
|
||||
CompletableFuture<T> result = new CompletableFuture<T>();
|
||||
// timeout 时间后 抛出TimeoutException 类似于sentinel / watcher
|
||||
Delayer.delayer.schedule(() -> result.completeExceptionally(new TimeoutException()), timeout, unit);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> CompletableFuture<T> timeoutAfter() {
|
||||
CompletableFuture<T> result = new CompletableFuture<T>();
|
||||
// timeout 时间后 抛出TimeoutException 类似于sentinel / watcher
|
||||
Delayer.delayer.schedule(() -> result.completeExceptionally(new TimeoutException()), TIMEOUT_VALUE, TIMEOUT_UNIT);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.utils.file;
|
||||
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@ -97,15 +98,28 @@ public class MyFileUtils extends FileUtils
|
||||
URL url = new URL(str);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");//POST
|
||||
InputStream inputStream = conn.getInputStream();
|
||||
FileOutputStream fos = new FileOutputStream(fileName);
|
||||
byte[] temp = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = inputStream.read(temp)) != -1) {
|
||||
fos.write(temp, 0, len);
|
||||
//防止屏蔽程序抓取而返回403错误
|
||||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
||||
conn.setConnectTimeout(5000);
|
||||
conn.setReadTimeout(5000);
|
||||
int responseCode = conn.getResponseCode();
|
||||
System.out.println("responseCode = " + responseCode);
|
||||
InputStream inputStream = conn.getInputStream();;
|
||||
byte[] temp = new byte[inputStream.available()];;
|
||||
if (200==responseCode) {
|
||||
if (temp.length==0) {
|
||||
ClassPathResource classPathResource = new ClassPathResource("/404.jpg");
|
||||
inputStream = classPathResource.getStream();
|
||||
temp = new byte[inputStream.available()];
|
||||
}
|
||||
FileOutputStream fos = new FileOutputStream(fileName);
|
||||
int len = 0;
|
||||
while ((len = inputStream.read(temp)) != -1) {
|
||||
fos.write(temp, 0, len);
|
||||
}
|
||||
inputStream.close();
|
||||
fos.close();
|
||||
}
|
||||
inputStream.close();
|
||||
fos.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -269,11 +283,11 @@ public class MyFileUtils extends FileUtils
|
||||
|
||||
StringBuilder contentDispositionValue = new StringBuilder();
|
||||
contentDispositionValue.append("attachment; filename=")
|
||||
.append(percentEncodedFileName)
|
||||
.append(";")
|
||||
.append("filename*=")
|
||||
.append("utf-8''")
|
||||
.append(percentEncodedFileName);
|
||||
.append(percentEncodedFileName)
|
||||
.append(";")
|
||||
.append("filename*=")
|
||||
.append("utf-8''")
|
||||
.append(percentEncodedFileName);
|
||||
|
||||
response.setHeader("Content-disposition", contentDispositionValue.toString());
|
||||
}
|
||||
|
||||
@ -92,8 +92,8 @@ public class FileUploadUtils
|
||||
*/
|
||||
public static final String extractFilename(MultipartFile file)
|
||||
{
|
||||
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
||||
FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
return StringUtils.format("{}/{}.{}", DateUtils.datePath(),
|
||||
Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
|
||||
31
ruoyi-rsaencrypt/pom.xml
Normal file
31
ruoyi-rsaencrypt/pom.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-rsaencrypt</artifactId>
|
||||
|
||||
<description>
|
||||
数据加密模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.antherd</groupId>
|
||||
<artifactId>sm-crypto</artifactId>
|
||||
<version>0.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,133 @@
|
||||
package com.ruoyi.rsaencrypt.advice;
|
||||
import cn.hutool.core.io.FastByteArrayOutputStream;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.stream.StreamUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.utils.StreamUtils;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpInputMessage;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Type;
|
||||
import java.rmi.ServerException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author monkey
|
||||
* @desc 请求数据解密
|
||||
* @date 2018/10/29 20:17
|
||||
*/
|
||||
@ControllerAdvice
|
||||
@RsaSecurityParameter()
|
||||
public class DecodeRequestBodyAdvice implements RequestBodyAdvice {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DecodeRequestBodyAdvice.class);
|
||||
|
||||
@Override
|
||||
public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object handleEmptyBody(Object body, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) throws IOException {
|
||||
try {
|
||||
if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
||||
//获取注解配置的包含和去除字段
|
||||
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
||||
//入参是否需要解密
|
||||
if (serializedField.inDecode()) {
|
||||
logger.info("注解RsaSecurityParameter,对方法method :【" + methodParameter.getMethod().getName() + "】返回数据进行解密");
|
||||
return new RsaHttpInputMessage(inputMessage);
|
||||
}
|
||||
}
|
||||
return inputMessage;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("对方法method :【" + methodParameter.getMethod().getName() + "】返回数据进行解密出现异常:" + e.getMessage());
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterBodyRead(Object body, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
|
||||
return body;
|
||||
}
|
||||
|
||||
class RsaHttpInputMessage implements HttpInputMessage {
|
||||
private HttpHeaders headers;
|
||||
|
||||
private InputStream body;
|
||||
|
||||
public RsaHttpInputMessage(HttpInputMessage inputMessage) throws Exception {
|
||||
this.headers = inputMessage.getHeaders();
|
||||
String targe="pc";
|
||||
List<String> list = headers.get("targe");
|
||||
if (ObjectUtil.isNotNull(list) && list.size()>0) {
|
||||
boolean wxixin = list.contains("weixin");
|
||||
if (wxixin) {
|
||||
targe = "weixin";
|
||||
}
|
||||
}
|
||||
this.body = IoUtil.toUtf8Stream(easpString(IoUtil.readUtf8(inputMessage.getBody()),targe));
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpHeaders getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public String easpString(String requestData,String targe) throws IOException {
|
||||
if (requestData != null && !requestData.equals("")) {
|
||||
if (StringUtils.isEmpty(requestData)) {
|
||||
throw new RuntimeException("参数【requestData】缺失异常!");
|
||||
} else {
|
||||
String content = null;
|
||||
try {
|
||||
logger.info("解密密文:"+requestData);
|
||||
if ("weixin".equals(targe)){
|
||||
content = RSAUtil.privateKeyDecryptStr(requestData);
|
||||
}else {
|
||||
String data1 = requestData.substring(1);
|
||||
String substring = requestData.substring(1, data1.length());
|
||||
content = RSAUtil.privateKeyDecryptStr(substring);
|
||||
}
|
||||
logger.info("解密明文:"+content);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("msg:参数【aseKey】解析异常!");
|
||||
}
|
||||
try {
|
||||
} catch (Exception e) {
|
||||
throw new ServerException("msg:参数【content】解析异常!");
|
||||
}
|
||||
if (StringUtils.isEmpty(content)) {
|
||||
throw new RuntimeException("msg:参数【requestData】解析参数空指针异常!");
|
||||
}
|
||||
return content;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("msg:参数【requestData】不合法异常!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.ruoyi.rsaencrypt.advice;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.text.UnicodeUtil;
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.rsaencrypt.annotation.RsaSecurityParameter;
|
||||
import com.ruoyi.rsaencrypt.utls.RSAUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author monkey
|
||||
* @desc 返回数据加密
|
||||
* @date 2018/10/25 20:17
|
||||
*/
|
||||
@ControllerAdvice
|
||||
@RsaSecurityParameter()
|
||||
public class EncodeResponseBodyAdvice implements ResponseBodyAdvice {
|
||||
private final static Logger logger = LoggerFactory.getLogger(EncodeResponseBodyAdvice.class);
|
||||
|
||||
@Override
|
||||
public boolean supports(MethodParameter methodParameter, Class aClass) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object beforeBodyWrite(Object body, MethodParameter methodParameter, MediaType mediaType, Class aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
|
||||
// 此处要用反射将字段中的注解解析出来
|
||||
if (methodParameter.getMethod().isAnnotationPresent(RsaSecurityParameter.class)) {
|
||||
//获取注解配置的包含和去除字段
|
||||
RsaSecurityParameter serializedField = methodParameter.getMethodAnnotation(RsaSecurityParameter.class);
|
||||
//出参是否需要加密
|
||||
if (serializedField.outEncode()) {
|
||||
return encodeRsa(methodParameter, body);
|
||||
}
|
||||
}
|
||||
JSONObject jsonObject = JSONUtil.parseObj(body);
|
||||
Object code = jsonObject.get("code");
|
||||
String num = "500";
|
||||
String num2 ="401";
|
||||
String num3 ="403";
|
||||
if (ObjectUtil.isNotNull(code)){
|
||||
if (num.equals(code.toString()) || num2.equals(code.toString()) || num3.equals(code.toString())){
|
||||
return encodeRsa(methodParameter, body);
|
||||
}
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* RSA私钥加密
|
||||
*
|
||||
* @param methodParameter
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
private Object encodeRsa(MethodParameter methodParameter, Object body) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
String result = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(body);
|
||||
logger.info("对返回数据 :【" + result + "】进行加密");
|
||||
String s = RSAUtil.publicKeyEncryptBase64(result);
|
||||
logger.info("加密之后密文:"+s);
|
||||
return s;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("对方法method :【" + methodParameter.getMethod().getName() + "】返回数据进行加密出现异常:" + e.getMessage());
|
||||
}
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.rsaencrypt.annotation;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author monkey
|
||||
* @desc 请求RSA数据解密
|
||||
* @date 2018/10/25 20:17
|
||||
*/
|
||||
@Target({ElementType.METHOD,ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Mapping
|
||||
@Documented
|
||||
@Order(0)
|
||||
public @interface RsaSecurityParameter {
|
||||
|
||||
/**
|
||||
* 入参是否解密,默认不解密
|
||||
*/
|
||||
boolean inDecode() default false;
|
||||
|
||||
/**
|
||||
* 出参是否加密,默认加密
|
||||
*/
|
||||
boolean outEncode() default true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.rsaencrypt.utls;
|
||||
import com.antherd.smcrypto.sm2.Sm2;
|
||||
|
||||
/**
|
||||
* RSA加解密工具类
|
||||
* @author Administrator
|
||||
*/
|
||||
public class RSAUtil {
|
||||
|
||||
|
||||
public static final String PRIVATE_KEY = "9cefdfcb925a32e10206d3a693ba204632c59e5f9a171faebb814885191dd35e";
|
||||
public static final String VUE_PUBLIC_KEY = "048af4184056315a9ecfcc14280b32504ba194ec8dd0e06b298c4a1aa557e7e9a5d15e1293392f741f7fb31a82e55785b7f1880d61b57def1e38e3f06435fb0502";
|
||||
public static final String PUBLIC_KEY1 = "0435661bb2d13bba88f47af0bbe243fcded8f27ac298932661787f88ea283c2b31fe427e1aa8410826a963e9114fe5ffab4ad278aeeb7f1f161e735d1f50570e78";
|
||||
/**
|
||||
* 公钥加密
|
||||
*/
|
||||
public static String publicKeyEncryptBase64(String data){
|
||||
return Sm2.doEncrypt(data, VUE_PUBLIC_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*/
|
||||
public static String privateKeyDecryptStr(String data){
|
||||
return Sm2.doDecrypt(data,PRIVATE_KEY);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.ruoyi.rsaencrypt.advice.DecodeRequestBodyAdvice,\
|
||||
com.ruoyi.rsaencrypt.advice.EncodeResponseBodyAdvice
|
||||
@ -16,12 +16,12 @@ public class WorkBusinessRule {
|
||||
|
||||
public String getDistrict(String district){
|
||||
//先获取业务数据
|
||||
|
||||
QueryWrapper<BuyHouseCheck> qw = new QueryWrapper<>();
|
||||
qw.eq("crux_key","buy_house_audit");
|
||||
qw.eq("other_key",district);
|
||||
BuyHouseCheckVo buyHouseCheckVo = buyHouseCheckMapper.selectVoOne(qw);
|
||||
return buyHouseCheckVo.getPerson();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -168,7 +169,7 @@ public class BuyHouses extends BaseEntity {
|
||||
private String companyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<BuyHousesMember> buyHousesMemberList;
|
||||
private List<BuyHousesMember> buyHousesMemberList=new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -54,4 +54,15 @@ public class MaterialModule extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String file;
|
||||
|
||||
|
||||
/**
|
||||
* 接口或者全路径地址
|
||||
*/
|
||||
private String interfacePath;
|
||||
|
||||
/**
|
||||
* 1是接口,2是路径
|
||||
*/
|
||||
private String interfaceType;
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ public class SubscribeExport extends BaseEntity {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
@ -36,4 +36,8 @@ public class SubscribeExport extends BaseEntity {
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
private String description;
|
||||
|
||||
private String processKey;
|
||||
|
||||
}
|
||||
|
||||
@ -3,12 +3,7 @@ package com.ruoyi.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
|
||||
@ -60,5 +60,15 @@ public class MaterialModuleBo extends BaseEntity {
|
||||
@NotNull(message = "是否必填不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isMust;
|
||||
|
||||
/**
|
||||
* 接口或者全路径地址
|
||||
*/
|
||||
private String interfacePath;
|
||||
|
||||
/**
|
||||
* 1是接口,2是路径
|
||||
*/
|
||||
private String interfaceType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
public class SubscribeExportBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
@ -39,5 +39,9 @@ public class SubscribeExportBo extends BaseEntity {
|
||||
@NotBlank(message = "申请人id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String userId;
|
||||
|
||||
private String description;
|
||||
|
||||
private String processKey;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,8 +8,6 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,182 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.system.domain.BuyHousesMember;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 buy_houses
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-02-24
|
||||
*/
|
||||
@Data
|
||||
public class BuyHousesEvent extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 户口簿内页/护照内页
|
||||
*/
|
||||
private String insidepageUrl;
|
||||
/**
|
||||
* 身份证/护照
|
||||
*/
|
||||
private String cardId;
|
||||
/**
|
||||
* 承诺书
|
||||
*/
|
||||
private String commitmentUrl;
|
||||
/**
|
||||
* 单位地址
|
||||
*/
|
||||
private String companyAddress;
|
||||
/**
|
||||
* 工作单位
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 申明书
|
||||
*/
|
||||
private String declarationUrl;
|
||||
/**
|
||||
* 企业所在地 1.新经济活力区 2.交子公园金融商务区 3.高新西区 4.生物城
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
private String education;
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
private String frontUrl;
|
||||
/**
|
||||
* 公园城市局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||
*/
|
||||
private String gyStatus;
|
||||
/**
|
||||
* 房屋记录
|
||||
*/
|
||||
private String homeRecordUrl;
|
||||
/**
|
||||
* 户口簿主页
|
||||
*/
|
||||
private String homepageUrl;
|
||||
/**
|
||||
* 劳动合同
|
||||
*/
|
||||
private String laborContractUrl;
|
||||
/**
|
||||
* 企业营业执照
|
||||
*/
|
||||
private String licenseUrl;
|
||||
/**
|
||||
* 婚姻状况 1.未婚 2.已婚 3.离异
|
||||
*/
|
||||
private String maritalStatus;
|
||||
/**
|
||||
* 婚姻证明材料
|
||||
*/
|
||||
private String maritalUrl;
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
private String nationality;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 区域部门审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||
*/
|
||||
private String qyStatus;
|
||||
/**
|
||||
* 身份证背面
|
||||
*/
|
||||
private String reverseUrl;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 社会事业局审核状态 1.待审核 2.退件 3.不通过 4.通过
|
||||
*/
|
||||
private String shStatus;
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String socialCode;
|
||||
/**
|
||||
* 社保证明
|
||||
*/
|
||||
private String socialSecurityUrl;
|
||||
/**
|
||||
* 状态 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 类型 A B C D
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date passTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String pictureInformationUrl;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String workAddress;
|
||||
|
||||
private String processKey;
|
||||
|
||||
private String processStatus;
|
||||
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private String version;
|
||||
|
||||
private String companyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String excelUserId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<BuyHousesMember> buyHousesMemberList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long[] ids;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.system.domain.BuyHousesMember;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 购房复审登记对象 houses_review
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-03-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class HousesReviewEvent extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 证件类型
|
||||
*/
|
||||
private String cardType;
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String card;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 资格序号
|
||||
*/
|
||||
private String qualification;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private String auditTime;
|
||||
/**
|
||||
* 预售证号
|
||||
*/
|
||||
private String presellCard;
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
private String dealType;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
/**
|
||||
* 项目区域
|
||||
*/
|
||||
private String projectArea;
|
||||
/**
|
||||
* 资格确认时间
|
||||
*/
|
||||
private String qualificationConfirmTime;
|
||||
/**
|
||||
* 资格预申请时间
|
||||
*/
|
||||
private String qualificationPreApplyTime;
|
||||
/**
|
||||
* 家庭类型
|
||||
*/
|
||||
private String familyType;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 登记失效时间
|
||||
*/
|
||||
private String registerFailureTime;
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
private String nationality;
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
private String maritalStatus;
|
||||
/**
|
||||
* 单位类型
|
||||
*/
|
||||
private String companyType;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
* 人才类型
|
||||
*/
|
||||
private String talentsType;
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
/**
|
||||
* 企业所在地
|
||||
*/
|
||||
private String companyAddress;
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
private String sourceBy;
|
||||
/**
|
||||
* 流程key
|
||||
*/
|
||||
private String processKey;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 工作单位所属区域
|
||||
*/
|
||||
private String companyAddressArea;
|
||||
|
||||
/**
|
||||
* d类字段扩展
|
||||
*/
|
||||
private String typeExtend;
|
||||
|
||||
private Date passTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String excelUserId;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long[] ids;
|
||||
|
||||
}
|
||||
@ -64,5 +64,15 @@ public class MaterialModuleVo {
|
||||
|
||||
private String file;
|
||||
|
||||
/**
|
||||
* 接口或者全路径地址
|
||||
*/
|
||||
private String interfacePath;
|
||||
|
||||
/**
|
||||
* 1是接口,2是路径
|
||||
*/
|
||||
private String interfaceType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ public class SubscribeExportVo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
@ -39,5 +39,9 @@ public class SubscribeExportVo {
|
||||
@ExcelProperty(value = "申请人id")
|
||||
private String userId;
|
||||
|
||||
private String description;
|
||||
|
||||
private String processKey;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -87,5 +87,4 @@ public class SysUserExportVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "部门负责人")
|
||||
private String leader;
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.BuyHouses;
|
||||
import com.ruoyi.system.domain.bo.BuyHousesBo;
|
||||
import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
||||
import com.ruoyi.system.domain.dto.DeclareListDTO;
|
||||
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
||||
|
||||
@ -68,7 +69,7 @@ public interface IBuyHousesService {
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
R subscribeExport(BuyHousesBo bo) throws IOException;
|
||||
R subscribeExport(BuyHousesEvent bo) throws IOException;
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
@ -76,4 +77,24 @@ public interface IBuyHousesService {
|
||||
* @param response
|
||||
*/
|
||||
void exportExcel(BuyHousesBo bo, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 判读当前用户是否提交过
|
||||
* @return
|
||||
*/
|
||||
R checkStatus();
|
||||
|
||||
/**
|
||||
* 获取当前用户日志
|
||||
* @return
|
||||
*/
|
||||
R getBuyHousesLogsByUserId();
|
||||
|
||||
|
||||
/**
|
||||
* 下载认定通知单
|
||||
* @return
|
||||
*/
|
||||
R downloadInform();
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.HousesReview;
|
||||
import com.ruoyi.system.domain.bo.HousesReviewBo;
|
||||
import com.ruoyi.system.domain.dto.HousesReviewEvent;
|
||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -63,7 +64,7 @@ public interface IHousesReviewService {
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
R subscribeExport(HousesReviewBo bo) throws IOException;
|
||||
R subscribeExport(HousesReviewEvent bo) throws IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -45,6 +45,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
@ -341,7 +342,7 @@ public class SysLoginService {
|
||||
* @param password
|
||||
* @return
|
||||
*/
|
||||
public String userLogin(String username, String password) {
|
||||
public Map<String,Object> userLogin(String username, String password) {
|
||||
User user = loadUserByUsername(username);
|
||||
Date updateTime = user.getUpdateTime();
|
||||
if (ObjectUtil.isNull(updateTime)){
|
||||
@ -358,7 +359,11 @@ public class SysLoginService {
|
||||
// 生成token
|
||||
LoginHelper.loginByDevice(loginUser, DeviceType.PC);
|
||||
recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
return StpUtil.getTokenValue();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
String tokenValue = StpUtil.getTokenValue();
|
||||
map.put("token",tokenValue);
|
||||
map.put("loginName",user.getLoginName());
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -20,21 +20,25 @@ import com.ruoyi.common.utils.poi.DeleteFileUtil;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.poi.ExportWordUtil;
|
||||
import com.ruoyi.common.utils.poi.ZipUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.*;
|
||||
import com.ruoyi.system.domain.bo.BuyHousesBo;
|
||||
import com.ruoyi.system.domain.dto.BuyHousesEvent;
|
||||
import com.ruoyi.system.domain.dto.DeclareListDTO;
|
||||
import com.ruoyi.system.domain.vo.BuyHousesVo;
|
||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||
import com.ruoyi.system.domain.vo.MaterialModuleVo;
|
||||
import com.ruoyi.system.mapper.BuyHousesMapper;
|
||||
import com.ruoyi.system.mapper.BuyHousesMemberMapper;
|
||||
import com.ruoyi.system.mapper.MaterialProofMapper;
|
||||
import com.ruoyi.system.mapper.SubscribeExportMapper;
|
||||
import com.ruoyi.system.service.IBuyHousesService;
|
||||
import com.ruoyi.work.domain.AuditLog;
|
||||
import com.ruoyi.work.domain.vo.ProcessVo;
|
||||
import com.ruoyi.work.mapper.AuditLogMapper;
|
||||
import com.ruoyi.work.utils.WorkComplyUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -44,8 +48,13 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -56,7 +65,6 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
|
||||
@Value("${file.template}")
|
||||
@ -83,6 +91,9 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
|
||||
private final SubscribeExportMapper subscribeExportMapper;
|
||||
|
||||
private final AuditLogMapper auditLogMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*/
|
||||
@ -158,6 +169,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
lqw.eq(bo.getPassTime() != null, BuyHouses::getPassTime, bo.getPassTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPictureInformationUrl()), BuyHouses::getPictureInformationUrl, bo.getPictureInformationUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWorkAddress()), BuyHouses::getWorkAddress, bo.getWorkAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()), BuyHouses::getProcessStatus, bo.getProcessStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@ -165,6 +177,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(BuyHousesBo bo) {
|
||||
//验证这个身份证是否提交过
|
||||
List<BuyHouses> buyHouses = baseMapper.selectList(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||
@ -201,6 +214,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(BuyHousesBo bo) {
|
||||
BuyHouses update = BeanUtil.toBean(bo, BuyHouses.class);
|
||||
validEntityBeforeSave(update);
|
||||
@ -227,12 +241,13 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
//验证当前状态是否可以修改
|
||||
//判断数据库中是否存在该人才通过身份证去验证
|
||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||
.eq(BuyHouses::getCardId, entity.getCardId()));
|
||||
Long userId = LoginHelper.getUserId();
|
||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId, userId));
|
||||
if (!Constants.SUBMIT.equals(buyHouses.getProcessStatus()) && !Constants.FAILD.equals(buyHouses.getProcessStatus())){
|
||||
throw new ServiceException("当前用户不可修改");
|
||||
}
|
||||
//删除家庭情况信息
|
||||
buyHousesMemberMapper.delete(new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId,buyHouses.getId()));
|
||||
//先删除家庭信息表
|
||||
if (entity.getBuyHousesMemberList().size()>0) {
|
||||
buyHousesMemberMapper.delete( new LambdaQueryWrapper<>(BuyHousesMember.class).eq(BuyHousesMember::getBuyHousesId, entity.getId()));
|
||||
@ -279,10 +294,12 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
|
||||
/**
|
||||
* 先保存再执行下载
|
||||
* @param buyHousesBo
|
||||
* @param bo
|
||||
*/
|
||||
@Override
|
||||
public R downloadWord(BuyHousesBo buyHousesBo) {
|
||||
public R downloadWord(BuyHousesBo bo) {
|
||||
BuyHouses buyHousesBo = BeanUtil.toBean(bo, BuyHouses.class);
|
||||
validEntityBeforeSave(buyHousesBo);
|
||||
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
|
||||
//判断数据库中是否存在该人才通过身份证去验证
|
||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||
@ -356,8 +373,9 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInfo(BuyHouses buyHouses) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
//先判断本地数据库是否有值
|
||||
BuyHousesVo buyHousesVo = baseMapper.selectVoOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getCardId,buyHouses.getCardId()));
|
||||
BuyHousesVo buyHousesVo = baseMapper.selectVoOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId,userId));
|
||||
if (ObjectUtil.isNotNull(buyHousesVo)){
|
||||
LambdaQueryWrapper<MaterialProof> wrapper = new LambdaQueryWrapper<MaterialProof>()
|
||||
.eq(MaterialProof::getHouseId, buyHousesVo.getId())
|
||||
@ -371,10 +389,10 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
return R.ok(buyHousesVo);
|
||||
}
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("cardId", buyHouses);
|
||||
paramMap.put("cardId", buyHouses.getCardId());
|
||||
String json = HttpUtil.get(URL, paramMap);
|
||||
JSONObject entrie = JSONUtil.parseObj(json);
|
||||
String data = String.valueOf(entrie.get("date"));
|
||||
String data = String.valueOf(entrie.get("data"));
|
||||
if (ObjectUtil.isNull(data)){
|
||||
return R.fail("获取失败");
|
||||
}
|
||||
@ -385,8 +403,8 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
buyHousesDto.setUserName(String.valueOf(entries.get("name")));
|
||||
buyHousesDto.setPhone(String.valueOf(entries.get("phone")));
|
||||
buyHousesDto.setCompanyName(String.valueOf(entries.get("companyName")));
|
||||
buyHousesDto.setDistrict(String.valueOf(entries.get("district")));
|
||||
buyHousesDto.setSex(String.valueOf(entries.get("sex")));
|
||||
buyHousesDto.setDistrict("1");
|
||||
buyHousesDto.setProcessStatus(Constants.SUBMIT);
|
||||
buyHousesDto.setType(String.valueOf(entries.get("type")));
|
||||
buyHousesDto.setProcessKey("apply_house");
|
||||
@ -433,11 +451,14 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R subscribeExport(BuyHousesBo bo) throws IOException {
|
||||
export(bo);
|
||||
public R subscribeExport(BuyHousesEvent bo) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
bo.setExcelUserId(userId.toString());
|
||||
SpringUtils.context().publishEvent(bo);
|
||||
return R.ok("预约成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*导出excel
|
||||
* @param bo
|
||||
@ -451,13 +472,112 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
ExcelUtil.exportExcel(buyHousesVoList,"人才列表", BuyHousesVo.class,response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否申请过
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R checkStatus() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<BuyHouses> buyHousesList = baseMapper.selectList(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId, userId));
|
||||
if (buyHousesList.size()>0){
|
||||
return R.ok();
|
||||
}
|
||||
return R.ok(201,"未申请过",null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户日志
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R getBuyHousesLogsByUserId() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getUserId, userId));
|
||||
List<AuditLog> auditLogList = auditLogMapper.selectList(new LambdaQueryWrapper<>(AuditLog.class).eq(AuditLog::getOtherId, buyHouses.getId()).orderByAsc(AuditLog::getCreateTime));
|
||||
if (auditLogList.size()>0){
|
||||
auditLogList.stream().forEach(a ->{
|
||||
if (ObjectUtil.isNull(a.getProcessKey())){
|
||||
// 1.待提交 2.受理中 3.受理退件 4.受理驳回 5.初审中 6.初审不通过 7.初审退件 8.审定中 9.审定不通过 10.审定通过 11.审定退件,12.资格取消
|
||||
switch (a.getStatus()){
|
||||
case "1":a.setStatus("待提交");
|
||||
break;
|
||||
case "2":a.setStatus("受理中");
|
||||
break;
|
||||
case "3":a.setStatus("受理退件");
|
||||
break;
|
||||
case "4":a.setStatus("受理驳回");
|
||||
break;
|
||||
case "5":a.setStatus("初审中");
|
||||
break;
|
||||
case "6":a.setStatus("初审不通过");
|
||||
break;
|
||||
case "7":a.setStatus("初审退件");
|
||||
break;
|
||||
case "8":a.setStatus("审定中");
|
||||
break;
|
||||
case "9":a.setStatus("审定不通过");
|
||||
break;
|
||||
case "10":a.setStatus("审定通过");
|
||||
break;
|
||||
case "11":a.setStatus("审定退件");
|
||||
break;
|
||||
case "12":a.setStatus("资格取消");
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
switch (a.getStatus()){
|
||||
case "1":a.setStatus("审核失败");
|
||||
break;
|
||||
case "2":a.setStatus("审核成功");
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("auditLog",auditLogList);
|
||||
map.put("status",buyHouses.getProcessStatus());
|
||||
map.put("id",buyHouses.getId());
|
||||
return R.ok("查询成功",map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R downloadInform() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
LinkedHashMap<String, Object> map = new LinkedHashMap<>();
|
||||
//判断数据库中是否存在该人才通过身份证去验证
|
||||
BuyHouses buyHouses = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class)
|
||||
.eq(BuyHouses::getUserId,userId)
|
||||
.eq(BuyHouses::getProcessStatus,Constants.SUCCEED));
|
||||
LinkedHashMap<String, Object> hashMap = new LinkedHashMap<>();
|
||||
hashMap.put("companyName",buyHouses.getCompanyName());
|
||||
hashMap.put("companyAddress",buyHouses.getCompanyAddress());
|
||||
hashMap.put("name",buyHouses.getUserName());
|
||||
hashMap.put("cardId",buyHouses.getCardId());
|
||||
hashMap.put("type",buyHouses.getType());
|
||||
hashMap.put("nationality", "中国籍".equals(buyHouses.getNationality()) ? "身份证" : "护照");
|
||||
String fileName = UUID.randomUUID().toString();
|
||||
String templatePath = fileUpload + "inform.docx";
|
||||
String word = ExportWordUtil.createWord(templatePath, filePath, fileName, hashMap);
|
||||
System.out.println("word = " + word);
|
||||
String file= download + prefix + "/" + fileName + ".docx";
|
||||
System.out.println("file = " + file);
|
||||
map.put("file",file);
|
||||
return R.ok(map);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 起步执行导出zip
|
||||
* @param bo
|
||||
* @param event
|
||||
* @throws IOException
|
||||
*/
|
||||
@Async
|
||||
public void export(BuyHousesBo bo) throws IOException {
|
||||
@EventListener
|
||||
public void export(BuyHousesEvent event) throws IOException {
|
||||
BuyHousesBo bo = BeanUtil.toBean(event, BuyHousesBo.class);
|
||||
bo.setProcessStatus(Constants.SUCCEED);
|
||||
LambdaQueryWrapper<BuyHouses> lqw = buildQueryWrapper(bo);
|
||||
List<BuyHousesVo> buyHousesVoList = baseMapper.selectVoList(lqw);
|
||||
String title = "人才认定申请表";
|
||||
@ -472,14 +592,15 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
Map<String, List<BuyHousesMember>> buyHousesMemberMap = buyHousesMemberList.stream().collect(Collectors.groupingBy(BuyHousesMember::getBuyHousesId));
|
||||
buyHousesVoList.stream().forEach(r -> {
|
||||
String userNameFile = path + separator + r.getUserName();
|
||||
File userFile = new File(userNameFile);
|
||||
if (!userFile.exists() && !userFile.isDirectory()) {
|
||||
userFile.mkdirs();
|
||||
System.out.println("userNameFile = " + userNameFile);
|
||||
try {
|
||||
Files.createDirectories(Paths.get(userNameFile));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
String s = userNameFile + separator + r.getUserName() + "--";
|
||||
|
||||
//护照或者身份证
|
||||
if (ObjectUtil.isNotNull(r.getInsidepageUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getInsidepageUrl())){
|
||||
String insidepageUrl = r.getInsidepageUrl();
|
||||
String fileName=null;
|
||||
if ("中国籍".equals(r.getNationality())){
|
||||
@ -490,116 +611,118 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
MyFileUtils.downLoadPic(insidepageUrl, fileName);
|
||||
}
|
||||
//申请表
|
||||
if (ObjectUtil.isNotNull(r.getCommitmentUrl())){
|
||||
/*if (ObjectUtil.isNotEmpty(r.getCommitmentUrl())){
|
||||
String commitmentUrl = r.getCommitmentUrl();
|
||||
String fileName= s + "申请表" + commitmentUrl.substring(commitmentUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(commitmentUrl, fileName);
|
||||
}
|
||||
|
||||
//申明书
|
||||
if (ObjectUtil.isNotNull(r.getDeclarationUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getDeclarationUrl())){
|
||||
String declarationUrl = r.getDeclarationUrl();
|
||||
String fileName= s + "申明书" + declarationUrl.substring(declarationUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(declarationUrl, fileName);
|
||||
}
|
||||
|
||||
//身份证正面
|
||||
if (ObjectUtil.isNotNull(r.getFrontUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getFrontUrl())){
|
||||
String frontUrl = r.getFrontUrl();
|
||||
String fileName= s + "身份证正面" + frontUrl.substring(frontUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(frontUrl, fileName);
|
||||
}
|
||||
|
||||
//房屋记录
|
||||
if (ObjectUtil.isNotNull(r.getHomeRecordUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getHomeRecordUrl())){
|
||||
String homeRecordUrl = r.getHomeRecordUrl();
|
||||
String fileName= s + "房屋记录" + homeRecordUrl.substring(homeRecordUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(homeRecordUrl, fileName);
|
||||
}
|
||||
|
||||
|
||||
//户口簿主页
|
||||
if (ObjectUtil.isNotNull(r.getHomepageUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getHomepageUrl())){
|
||||
String homepageUrl = r.getHomepageUrl();
|
||||
String fileName= s + "户口簿主页" + homepageUrl.substring(homepageUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(homepageUrl, fileName);
|
||||
}
|
||||
|
||||
//劳动合同
|
||||
if (ObjectUtil.isNotNull(r.getLaborContractUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getLaborContractUrl())){
|
||||
String laborContractUrl = r.getLaborContractUrl();
|
||||
String fileName= s + "劳动合同" + laborContractUrl.substring(laborContractUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(laborContractUrl, fileName);
|
||||
}
|
||||
|
||||
//企业营业执照
|
||||
if (ObjectUtil.isNotNull(r.getLicenseUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getLicenseUrl())){
|
||||
String licenseUrl = r.getLicenseUrl();
|
||||
String fileName= s + "企业营业执照" + licenseUrl.substring(licenseUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(licenseUrl, fileName);
|
||||
}
|
||||
|
||||
//户口簿主页
|
||||
if (ObjectUtil.isNotNull(r.getHomepageUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getHomepageUrl())){
|
||||
String homepageUrl = r.getHomepageUrl();
|
||||
String fileName= s + "户口簿主页" + homepageUrl.substring(homepageUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(homepageUrl, fileName);
|
||||
}
|
||||
|
||||
//婚姻证明材料
|
||||
if (ObjectUtil.isNotNull(r.getMaritalUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getMaritalUrl())){
|
||||
String maritalUrl = r.getMaritalUrl();
|
||||
String fileName= s + "婚姻证明材料" + maritalUrl.substring(maritalUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(maritalUrl, fileName);
|
||||
}
|
||||
|
||||
//身份证背面
|
||||
if (ObjectUtil.isNotNull(r.getReverseUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getReverseUrl())){
|
||||
String reverseUrl = r.getReverseUrl();
|
||||
String fileName= s + "身份证背面" + reverseUrl.substring(reverseUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(reverseUrl, fileName);
|
||||
}
|
||||
|
||||
//社保证明
|
||||
if (ObjectUtil.isNotNull(r.getSocialSecurityUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getSocialSecurityUrl())){
|
||||
String socialSecurityUrl = r.getSocialSecurityUrl();
|
||||
String fileName= s + "社保证明" + socialSecurityUrl.substring(socialSecurityUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(socialSecurityUrl, fileName);
|
||||
}
|
||||
|
||||
//人才影像卡
|
||||
if (ObjectUtil.isNotNull(r.getPictureInformationUrl())){
|
||||
if (ObjectUtil.isNotEmpty(r.getPictureInformationUrl())){
|
||||
String pictureInformationUrl = r.getPictureInformationUrl();
|
||||
String fileName= s + "人才影像卡" + pictureInformationUrl.substring(pictureInformationUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(pictureInformationUrl, fileName);
|
||||
}
|
||||
|
||||
List<BuyHousesMember> buyHousesMembers = buyHousesMemberMap.get(r.getId().toString());
|
||||
if (buyHousesMembers.size()>0) {
|
||||
}*/
|
||||
//家庭信息
|
||||
/* List<BuyHousesMember> buyHousesMembers = buyHousesMemberMap.get(r.getId().toString());
|
||||
if (ObjectUtil.isNotNull(buyHousesMembers)) {
|
||||
buyHousesMembers.stream().forEach(m -> {
|
||||
String userNameFile1 = path + separator + m.getName();
|
||||
if (ObjectUtil.isNotNull(m.getFrontUrl())) {
|
||||
System.out.println("m = " + m);
|
||||
// String userNameFile1 = path + separator + m.getName();
|
||||
if (ObjectUtil.isNotEmpty(m.getFrontUrl())) {
|
||||
String frontUrl = m.getFrontUrl();
|
||||
String fileName = userNameFile1 + separator + m.getRelation() + "身份证正面" + frontUrl.substring(frontUrl.lastIndexOf("."), frontUrl.length());
|
||||
String fileName = s + m.getRelation() + "身份证正面" + frontUrl.substring(frontUrl.lastIndexOf("."), frontUrl.length());
|
||||
MyFileUtils.downLoadPic(frontUrl, fileName);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(m.getInsidepageUrl())) {
|
||||
if (ObjectUtil.isNotEmpty(m.getInsidepageUrl())) {
|
||||
String insidepageUrl = m.getInsidepageUrl();
|
||||
String fileName = userNameFile1 + separator + m.getRelation() + "户口簿内页" + insidepageUrl.substring(insidepageUrl.lastIndexOf("."), insidepageUrl.length());
|
||||
String fileName = s + m.getRelation() + "户口簿内页" + insidepageUrl.substring(insidepageUrl.lastIndexOf("."));
|
||||
MyFileUtils.downLoadPic(insidepageUrl, fileName);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(m.getReverseUrl())) {
|
||||
if (ObjectUtil.isNotEmpty(m.getReverseUrl())) {
|
||||
String reverseUrl = m.getReverseUrl();
|
||||
String fileName = userNameFile1 + separator + m.getRelation() + "身份证正面" + reverseUrl.substring(reverseUrl.lastIndexOf("."), reverseUrl.length());
|
||||
String fileName = s + m.getRelation() + "身份证正面" + reverseUrl.substring(reverseUrl.lastIndexOf("."), reverseUrl.length());
|
||||
MyFileUtils.downLoadPic(reverseUrl, fileName);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(m.getHomeRecordUrl())) {
|
||||
if (ObjectUtil.isNotEmpty(m.getHomeRecordUrl())) {
|
||||
String homeRecordUrl = m.getHomeRecordUrl();
|
||||
String fileName = userNameFile1 + separator + m.getRelation() + "身份证正面" + homeRecordUrl.substring(homeRecordUrl.lastIndexOf("."), homeRecordUrl.length());
|
||||
String fileName = s + m.getRelation() + "身份证正面" + homeRecordUrl.substring(homeRecordUrl.lastIndexOf("."), homeRecordUrl.length());
|
||||
MyFileUtils.downLoadPic(homeRecordUrl, fileName);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}*/
|
||||
});
|
||||
String p = path + separator + title + ".xlsx";
|
||||
String fo = filePath + separator + format + ".zip";
|
||||
@ -621,10 +744,13 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
//生成后删除文件
|
||||
DeleteFileUtil.delete(path);
|
||||
String zip = format+".zip";
|
||||
String url =download+prefix+zip;
|
||||
String url =download+prefix+"/"+zip;
|
||||
System.out.println("url = " + url);
|
||||
SubscribeExport subscribeExport = new SubscribeExport();
|
||||
subscribeExport.setPath(url);
|
||||
subscribeExport.setUserId(LoginHelper.getUserId().toString());
|
||||
subscribeExport.setProcessKey(event.getProcessKey());
|
||||
subscribeExport.setDescription(event.getDescription());
|
||||
subscribeExport.setUserId(event.getExcelUserId());
|
||||
subscribeExportMapper.insert(subscribeExport);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -14,8 +15,10 @@ import com.ruoyi.common.utils.file.MyFileUtils;
|
||||
import com.ruoyi.common.utils.poi.DeleteFileUtil;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.poi.ZipUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.*;
|
||||
import com.ruoyi.system.domain.bo.HousesReviewBo;
|
||||
import com.ruoyi.system.domain.dto.HousesReviewEvent;
|
||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||
import com.ruoyi.system.domain.vo.MaterialModuleVo;
|
||||
import com.ruoyi.system.mapper.BuyHousesReviewMemberMapper;
|
||||
@ -27,6 +30,7 @@ import com.ruoyi.work.domain.vo.ProcessVo;
|
||||
import com.ruoyi.work.utils.WorkComplyUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -48,7 +52,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Transactional
|
||||
|
||||
public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
|
||||
private final HousesReviewMapper baseMapper;
|
||||
@ -139,7 +143,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCreditCode()), HousesReview::getCreditCode, bo.getCreditCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCompanyAddress()), HousesReview::getCompanyAddress, bo.getCompanyAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSourceBy()), HousesReview::getSourceBy, bo.getSourceBy());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessKey()), HousesReview::getProcessKey, bo.getProcessKey());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()), HousesReview::getProcessStatus, bo.getProcessStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@ -147,6 +151,7 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
* 新增购房复审登记
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(HousesReviewBo bo) {
|
||||
//先判断是否存在数据
|
||||
HousesReview add = BeanUtil.toBean(bo, HousesReview.class);
|
||||
@ -170,90 +175,18 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
* 修改购房复审登记
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(HousesReviewBo bo) {
|
||||
bo.setProcessStatus("wait");
|
||||
//先删除存在的关系表
|
||||
LambdaQueryWrapper<BuyHousesReviewMember> wrapper = new LambdaQueryWrapper<BuyHousesReviewMember>()
|
||||
.eq(BuyHousesReviewMember::getBuyHousesId, bo.getId());
|
||||
List<BuyHousesReviewMember> buyHousesReviewMembers = buyHousesReviewMemberMapper.selectList(wrapper);
|
||||
if (ObjectUtil.isNotNull(buyHousesReviewMembers) && buyHousesReviewMembers.size()>0) {
|
||||
List<BuyHousesReviewMember> buyHousesMemberList = bo.getBuyHousesMemberList();
|
||||
//先删除minio的图片
|
||||
List<Long> list = new ArrayList<>();
|
||||
if (ObjectUtil.isNotNull(buyHousesMemberList) && buyHousesMemberList.size()>0) {
|
||||
buyHousesReviewMembers.forEach(e -> {
|
||||
if (ObjectUtil.isNotNull(e.getFrontUrl())){
|
||||
if (!buyHousesMemberList.stream().anyMatch(b -> e.getFrontUrl().equals(b.getFrontUrl()))){
|
||||
list.add(new Long(e.getFrontUrl()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotNull(e.getInsidepageUrl())) {
|
||||
if (!buyHousesMemberList.stream().anyMatch(b -> e.getInsidepageUrl().equals(b.getInsidepageUrl()))) {
|
||||
list.add(new Long(e.getInsidepageUrl()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotNull(e.getHomeRecordUrl())) {
|
||||
if (!buyHousesMemberList.stream().anyMatch(b -> ObjectUtil.isNotNull(e.getHomeRecordUrl()) && e.getHomeRecordUrl().equals(b.getHomeRecordUrl()))) {
|
||||
list.add(new Long(e.getHomeRecordUrl()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotNull(e.getReverseUrl())) {
|
||||
if (!buyHousesMemberList.stream().anyMatch(b -> ObjectUtil.isNotNull(e.getReverseUrl()) && e.getReverseUrl().equals(b.getReverseUrl()))) {
|
||||
list.add(new Long(e.getReverseUrl()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
List<Long> insidepageUrl = buyHousesReviewMembers.stream().filter(s ->ObjectUtil.isNotNull(s.getInsidepageUrl())).map(s -> Long.parseLong(s.getInsidepageUrl())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(insidepageUrl)&& insidepageUrl.size()>0){
|
||||
list.addAll(insidepageUrl);
|
||||
}
|
||||
List<Long> homeRecordUrl = buyHousesReviewMembers.stream().filter(s ->ObjectUtil.isNotNull(s.getHomeRecordUrl())).map(s -> Long.parseLong(s.getHomeRecordUrl())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(homeRecordUrl)&& homeRecordUrl.size()>0){
|
||||
list.addAll(homeRecordUrl);
|
||||
}
|
||||
List<Long> reverseUrl = buyHousesReviewMembers.stream().filter(s ->ObjectUtil.isNotNull(s.getReverseUrl())).map(s -> Long.parseLong(s.getReverseUrl())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(reverseUrl)&& reverseUrl.size()>0){
|
||||
list.addAll(reverseUrl);
|
||||
}
|
||||
List<Long> frontUrl = buyHousesReviewMembers.stream().filter(s ->ObjectUtil.isNotNull(s.getFrontUrl())).map(s -> Long.parseLong(s.getFrontUrl())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(frontUrl)&& frontUrl.size()>0){
|
||||
list.addAll(frontUrl);
|
||||
}
|
||||
}
|
||||
if (list.size()>0){
|
||||
sysOssService.deleteWithValidByIds(list,true);
|
||||
}
|
||||
List<Long> collect = buyHousesReviewMembers.stream().map(BuyHousesReviewMember::getId).collect(Collectors.toList());
|
||||
if (collect.size()>0) {
|
||||
buyHousesReviewMemberMapper.deleteBatchIds(collect);
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<MaterialProof> queryWrapper = new LambdaQueryWrapper<MaterialProof>()
|
||||
.eq(MaterialProof::getHouseId, bo.getId());
|
||||
List<MaterialProof> materialProofs = materialProofMapper.selectList(queryWrapper);
|
||||
if (ObjectUtil.isNotNull(materialProofs) && materialProofs.size()>0) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<MaterialModule> materialsList = bo.getMaterialsList();
|
||||
if (ObjectUtil.isNotNull(materialsList) && materialsList.size() > 0){
|
||||
materialProofs.forEach(mp ->{
|
||||
boolean b = materialsList.stream().anyMatch(e -> ObjectUtil.isNotNull(mp.getFile()) && mp.getFile().equals(e.getFile()));
|
||||
if (!b){
|
||||
Long aLong = new Long(mp.getFile());
|
||||
list.add(aLong);
|
||||
}
|
||||
});
|
||||
}else {
|
||||
list.addAll(materialProofs.stream().filter(s ->ObjectUtil.isNotNull(s.getFile())).map(s -> Long.parseLong(s.getFile())).collect(Collectors.toList()));
|
||||
}
|
||||
if (list.size()>0) {
|
||||
sysOssService.deleteWithValidByIds(list, true);
|
||||
}
|
||||
List<Long> collect = materialProofs.stream().map(MaterialProof::getId).collect(Collectors.toList());
|
||||
if (collect.size()>0) {
|
||||
materialProofMapper.deleteBatchIds(collect);
|
||||
}
|
||||
}
|
||||
bo.setProcessStatus(Constants.WAIT);
|
||||
//先删除存在的家庭情况关系表
|
||||
buyHousesReviewMemberMapper.delete( new LambdaQueryWrapper<BuyHousesReviewMember>()
|
||||
.eq(BuyHousesReviewMember::getBuyHousesId, bo.getId()));
|
||||
|
||||
//删除补充材料
|
||||
materialProofMapper.delete(new LambdaQueryWrapper<MaterialProof>()
|
||||
.eq(MaterialProof::getHouseId, bo.getId())
|
||||
.eq(MaterialProof::getProcessKey,"house_review"));
|
||||
|
||||
if (ObjectUtil.isNotNull(bo.getBuyHousesMemberList()) && bo.getBuyHousesMemberList().size()>0){
|
||||
bo.getBuyHousesMemberList().stream().forEach( e ->{
|
||||
e.setBuyHousesId(bo.getId().toString());
|
||||
@ -360,8 +293,10 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R subscribeExport(HousesReviewBo bo) throws IOException {
|
||||
export(bo);
|
||||
public R subscribeExport(HousesReviewEvent bo) throws IOException {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
bo.setExcelUserId(userId.toString());
|
||||
SpringUtils.context().publishEvent(bo);
|
||||
return R.ok("预约成功");
|
||||
}
|
||||
|
||||
@ -378,7 +313,9 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
}
|
||||
|
||||
@Async
|
||||
public void export(HousesReviewBo bo) throws IOException {
|
||||
@EventListener
|
||||
public void export(HousesReviewEvent event) throws IOException {
|
||||
HousesReviewBo bo = BeanUtil.toBean(event, HousesReviewBo.class);
|
||||
LambdaQueryWrapper<HousesReview> lqw = buildQueryWrapper(bo);
|
||||
List<HousesReview> housesReviews = baseMapper.selectList(lqw);
|
||||
if (housesReviews.size() > 0) {
|
||||
@ -402,7 +339,6 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
String s = userNameFile + separator + r.getName() + "--";
|
||||
String file = p.getFile();
|
||||
MyFileUtils.downLoadPic(file, s + p.getDescription() + file.substring(file.lastIndexOf(".")));
|
||||
// MyFileUtils.writeBytes(file, s + p.getDescription() + file.substring(file.lastIndexOf(".")));
|
||||
System.out.println("file = " + file);
|
||||
});
|
||||
}
|
||||
@ -427,9 +363,11 @@ public class HousesReviewServiceImpl implements IHousesReviewService {
|
||||
//生成后删除文件
|
||||
DeleteFileUtil.delete(path);
|
||||
String zip = format+".zip";
|
||||
String url =download+prefix+zip;
|
||||
String url =download+prefix+"/"+zip;
|
||||
SubscribeExport subscribeExport = new SubscribeExport();
|
||||
subscribeExport.setPath(url);
|
||||
subscribeExport.setDescription(event.getDescription());
|
||||
subscribeExport.setProcessKey("house_review");
|
||||
subscribeExport.setUserId(LoginHelper.getUserId().toString());
|
||||
subscribeExportMapper.insert(subscribeExport);
|
||||
}
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.common.utils.poi.DeleteFileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.domain.bo.SubscribeExportBo;
|
||||
import com.ruoyi.system.domain.vo.SubscribeExportVo;
|
||||
@ -31,6 +34,16 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
||||
|
||||
private final SubscribeExportMapper baseMapper;
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@Value("${file.domain}")
|
||||
private String download;
|
||||
|
||||
@Value("${file.prefix}")
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 查询预约导出
|
||||
*/
|
||||
@ -44,6 +57,7 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SubscribeExportVo> queryPageList(SubscribeExportBo bo, PageQuery pageQuery) {
|
||||
bo.setUserId(LoginHelper.getUserId().toString());
|
||||
LambdaQueryWrapper<SubscribeExport> lqw = buildQueryWrapper(bo);
|
||||
Page<SubscribeExportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
@ -63,6 +77,7 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
||||
LambdaQueryWrapper<SubscribeExport> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPath()), SubscribeExport::getPath, bo.getPath());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), SubscribeExport::getUserId, bo.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessKey()), SubscribeExport::getProcessKey, bo.getProcessKey());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@ -104,6 +119,13 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
//删除服务器本地得资源
|
||||
List<SubscribeExport> subscribeExports = baseMapper.selectBatchIds(ids);
|
||||
String path = subscribeExports.get(0).getPath();
|
||||
//将地址转为路径
|
||||
String replace = path.replace(download+prefix, filePath);
|
||||
System.out.println("replace = " + replace);
|
||||
DeleteFileUtil.delete(replace);
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@ -16,9 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="description" column="description"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="isMust" column="is_must"/>
|
||||
<result property="interfacePath" column="interface_path"/>
|
||||
<result property="interfaceType" column="interface_type"/>
|
||||
</resultMap>
|
||||
<select id="selectVoPageList" resultMap="MaterialModuleResult">
|
||||
SELECT m.id,material_name,`material_key`,s.dept_name AS audit_dept,description,m.sort,m.is_must
|
||||
SELECT m.id,material_name,`material_key`,s.dept_name AS audit_dept,description,m.sort,m.is_must,m.interface_path,m.interface_type
|
||||
FROM `material_module` m
|
||||
LEFT JOIN sys_dept s ON s.dept_id = m.audit_dept
|
||||
${ew.getCustomSqlSegment}
|
||||
|
||||
@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="path" column="path"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="processKey" column="process_key"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.work.utils;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.BetweenFormatter;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
@ -650,7 +652,7 @@ public class WorkComplyUtils {
|
||||
List<ProcessVo> list = new ArrayList<>();
|
||||
if (1L == e.getProcessCheck()) {
|
||||
String[] split = e.getAudit().split(",");
|
||||
e.setSize(split.length);
|
||||
// e.setSize(split.length);
|
||||
for (String s : split) {
|
||||
e.setAudit(s);
|
||||
e.setChecked("");
|
||||
@ -666,9 +668,8 @@ public class WorkComplyUtils {
|
||||
//将某些固定的审核人员添加进去
|
||||
if (ObjectUtil.isNotEmpty(e.getAudit())) {
|
||||
String[] split = e.getAudit().split(",");
|
||||
Collections.addAll(personByRule, split);
|
||||
CollectionUtil.addAll(personByRule,split);
|
||||
}
|
||||
e.setSize(personByRule.size());
|
||||
for (String s : personByRule) {
|
||||
e.setAudit(s);
|
||||
e.setChecked("");
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.work.utils;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
@ -91,7 +92,7 @@ public class WorkUtils {
|
||||
if (obj == null) {
|
||||
throw new ServiceException("任务环节未配置审批人,请确认传值是否正确,检查:【" + businessRule.getBeanName() + "】Bean容器中【" + methodName + "】方法");
|
||||
}
|
||||
return Arrays.asList(obj.toString().split(","));
|
||||
return CollUtil.newArrayList(obj.toString().split(","));
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user