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
696b39e6af
commit
153b4e8c0b
@ -94,11 +94,10 @@
|
||||
<artifactId>ruoyi-file</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-rabbitmq</artifactId>
|
||||
<version>4.7.0</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
|
||||
<!-- skywalking 整合 logback -->
|
||||
<!-- <dependency>-->
|
||||
|
||||
@ -64,34 +64,36 @@ public class CaptchaController {
|
||||
/**
|
||||
* 短信验证码
|
||||
*
|
||||
* @param phonenumber 用户手机号
|
||||
* @param username 用户手机号
|
||||
*/
|
||||
@GetMapping("/captchaSms")
|
||||
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
|
||||
|
||||
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String username) {
|
||||
if (!smsProperties.getEnabled()) {
|
||||
return R.fail("当前系统没有开启短信功能!");
|
||||
}
|
||||
//判断系统中是否存在该人才
|
||||
SysUser user = sysUserMapper.selectOne(new LambdaQueryWrapper<SysUser>()
|
||||
.select(SysUser::getPhonenumber, SysUser::getStatus)
|
||||
.eq(SysUser::getPhonenumber, phonenumber));
|
||||
.eq(SysUser::getPhonenumber, username));
|
||||
if (ObjectUtil.isNull(user)) {
|
||||
log.info("登录用户:{} 不存在.", phonenumber);
|
||||
throw new UserException("user.not.exists", phonenumber);
|
||||
log.info("登录用户:{} 不存在.", username);
|
||||
throw new UserException("user.not.exists", username);
|
||||
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||
log.info("登录用户:{} 已被停用.", phonenumber);
|
||||
throw new UserException("user.blocked", phonenumber);
|
||||
log.info("登录用户:{} 已被停用.", username);
|
||||
throw new UserException("user.blocked", username);
|
||||
}
|
||||
String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
|
||||
String key = CacheConstants.CAPTCHA_CODE_KEY + username;
|
||||
String code = RandomUtil.randomNumbers(6);
|
||||
System.out.println("code = " + code);
|
||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||
TelecomSendMsg smsTemplate = SpringUtils.getBean(TelecomSendMsg.class);
|
||||
SmsResult result = smsTemplate.telecomSendCode(phonenumber, code, "login");
|
||||
SmsResult result = smsTemplate.telecomSendCode(username, code, "login");
|
||||
if (!result.isSuccess()) {
|
||||
log.error("验证码短信发送异常 => {}", result);
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
return R.ok("发送成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -79,7 +79,7 @@ public class SysLoginController {
|
||||
@RequestBody SmsLoginBody smsLoginBody) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
// 生成令牌
|
||||
String token = loginService.smsLogin(smsLoginBody.getPhonenumber(), smsLoginBody.getSmsCode());
|
||||
String token = loginService.smsLogin(smsLoginBody.getUsername(), smsLoginBody.getVerificationCode());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return R.ok(ajax);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.web.controller.user;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
@ -131,4 +132,10 @@ public class HouseController extends BaseController {
|
||||
bo.setApiKey("gaoxingongyuanchengshiju");
|
||||
return iBuyHousesService.insertOpenBuyHouses(bo);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@GetMapping("/excelZip")
|
||||
public void excelZip(){
|
||||
iBuyHousesService.excelZip();
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,10 +52,16 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://182.150.40.133:3309/ry-vue-house?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
# url: jdbc:mysql://localhost:3306/ry-vue-jinniu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 1234Qwer@
|
||||
#测试地址
|
||||
# url: jdbc:mysql://182.150.40.133:3309/ry-vue-house?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/ry-vue-jinniu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
# username: root
|
||||
# password: 1234Qwer@
|
||||
#正式地址
|
||||
url: jdbc:mysql://172.12.9.1:3409/ry-vue-house?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/ry-vue-jinniu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: gxrc
|
||||
password: 45Uuq5!aADGD
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
|
||||
@ -3,7 +3,6 @@ package com.ruoyi.test;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.resource.ClassPathResource;
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@ -26,14 +25,9 @@ import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.helper.DataBaseHelper;
|
||||
import com.ruoyi.common.utils.AesUtil;
|
||||
import com.ruoyi.common.utils.CardsUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.MyFileUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.demo.domain.ImageDemoData;
|
||||
import com.ruoyi.mq.config.PluginDelayRabbitConfig;
|
||||
import com.ruoyi.mq.config.TalentsDelayRabbitConfig;
|
||||
import com.ruoyi.system.domain.*;
|
||||
import com.ruoyi.system.domain.vo.HousesReviewVo;
|
||||
import com.ruoyi.system.domain.vo.MaterialTalentsVo;
|
||||
@ -56,13 +50,9 @@ import com.ruoyi.work.utils.WorkComplyUtils;
|
||||
import org.apache.commons.text.CaseUtils;
|
||||
import org.bouncycastle.crypto.engines.SM2Engine;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.springframework.amqp.AmqpException;
|
||||
import org.springframework.amqp.core.*;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -71,7 +61,6 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyPair;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -141,8 +130,8 @@ public class DemoUnitTest {
|
||||
@Autowired
|
||||
private BuyHousesServiceImpl buyHousesService;
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate amqpTemplate;
|
||||
// @Autowired
|
||||
// private RabbitTemplate amqpTemplate;
|
||||
|
||||
|
||||
@DisplayName("测试 @SpringBootTest @Test @DisplayName 注解")
|
||||
@ -806,18 +795,23 @@ public class DemoUnitTest {
|
||||
System.out.println("privateKey = " + privateKey);*/
|
||||
// String substring = DesensitizedUtil.idCardNum("510503199602214055", 4, 0).substring(0, 9);
|
||||
// System.out.println("card = " + substring);
|
||||
buyHousesService.excelZip();
|
||||
|
||||
String str ="https://gx.chengdutalent.cn:8010/upload/GXTalents/images/a6b742bc7843405da406b0159179dcfd.jpg";
|
||||
String substring = str.substring(str.lastIndexOf("/") + 1);
|
||||
|
||||
String txt ="https://rcaj.cdhtgycs.cn/images/2023/07/01/"+substring;
|
||||
buyHousesService.excelZip();
|
||||
System.out.println("txt = " + txt);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TestMessageAck() throws UnsupportedEncodingException {
|
||||
String msg="消息4";
|
||||
Message build = MessageBuilder.withBody(msg.getBytes()).build();
|
||||
build.getMessageProperties().setDeliveryMode(MessageDeliveryMode.PERSISTENT);
|
||||
build.getMessageProperties().setDelay(50000);
|
||||
amqpTemplate.convertAndSend(TalentsDelayRabbitConfig.TALENTS_PLUGIN_DELAY_EXCHANGE,TalentsDelayRabbitConfig.TALENTS_PLUGIN_DELAY_KEY,build);
|
||||
// String msg="消息4";
|
||||
// Message build = MessageBuilder.withBody(msg.getBytes()).build();
|
||||
// build.getMessageProperties().setDeliveryMode(MessageDeliveryMode.PERSISTENT);
|
||||
// build.getMessageProperties().setDelay(50000);
|
||||
// amqpTemplate.convertAndSend(TalentsDelayRabbitConfig.TALENTS_PLUGIN_DELAY_EXCHANGE,TalentsDelayRabbitConfig.TALENTS_PLUGIN_DELAY_KEY,build);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,12 +17,12 @@ public class SmsLoginBody {
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "{user.phonenumber.not.blank}")
|
||||
private String phonenumber;
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 短信code
|
||||
*/
|
||||
@NotBlank(message = "{sms.code.not.blank}")
|
||||
private String smsCode;
|
||||
private String verificationCode;
|
||||
|
||||
}
|
||||
|
||||
@ -35,13 +35,13 @@ public class TelecomSendMsg{
|
||||
paramMap.put("Mobile",phones);
|
||||
String gbk = null;
|
||||
if ("register".equals(type)){
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户注册操作,我们不会向您索要此验证码,切勿告知他人.次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户注册操作,我们不会向您索要此验证码,切勿告知他人本次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
}else if ("login".equals(type)){
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户登录操作,我们不会向您索要此验证码,切勿告知他人.次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户登录操作,我们不会向您索要此验证码,切勿告知他人本次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
}else if ("forgetPwd".equals(type)){
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户忘记密码操作,我们不会向您索要此验证码,切勿告知他人.次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户忘记密码操作,我们不会向您索要此验证码,切勿告知他人本次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
}else if("updatePwd".equals(type)){
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户修改密码,我们不会向您索要此验证码,切勿告知他人.次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
gbk = URLEncoder.encode("验证码:"+content+".尊敬的用户,您正在办理用户修改密码,我们不会向您索要此验证码,切勿告知他人本次验证码有效性为:"+ Constants.CAPTCHA_EXPIRATION +"分钟.【成都高新人才安居资格认定】", "GBK");
|
||||
}else if ("updatePhone".equals(type)){
|
||||
|
||||
}
|
||||
|
||||
@ -43,5 +43,7 @@ public class SubscribeExportBo extends BaseEntity {
|
||||
|
||||
private String processKey;
|
||||
|
||||
private String exportStatus;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -123,4 +123,7 @@ public interface IBuyHousesService {
|
||||
R getBasicData();
|
||||
|
||||
R getHistogram(String date);
|
||||
|
||||
void excelZip();
|
||||
|
||||
}
|
||||
|
||||
@ -756,6 +756,11 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
BuyHouses buyHouses = BeanUtil.toBean(bo, BuyHouses.class);
|
||||
buyHouses.setStep("1");
|
||||
BuyHouses buyHouses1 = baseMapper.selectOne(new LambdaQueryWrapper<>(BuyHouses.class).eq(BuyHouses::getCardId, buyHouses.getCardId()));
|
||||
//判断该人才是否存在
|
||||
if (ObjectUtil.isEmpty(buyHouses1.getApiKey()) || !buyHouses1.getUserId().equals(buyHouses.getUserId())){
|
||||
throw new ServiceException("当前用户已在系统存在");
|
||||
// return R.fail("当前用户已在系统存在");
|
||||
}
|
||||
if (ObjectUtil.isNull(buyHouses1)){
|
||||
//新增
|
||||
buyHouses.setProcessStatus(Constants.WAIT);
|
||||
@ -764,7 +769,8 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
buyHouses.setUpdateTime(new Date());
|
||||
int insert = baseMapper.insert(buyHouses);
|
||||
if (insert==0){
|
||||
return R.fail("新增失败");
|
||||
throw new ServiceException("新增失败");
|
||||
// return R.fail("新增失败");
|
||||
}
|
||||
//创建关系材料表
|
||||
List<BuyHousesMember> buyHousesMemberList = buyHouses.getBuyHousesMemberList();
|
||||
@ -774,23 +780,21 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
});
|
||||
}
|
||||
buyHousesMemberMapper.insertBatch(buyHousesMemberList);
|
||||
|
||||
}else {
|
||||
//判断状态是否在可执行范围
|
||||
if (!Constants.WAIT.equals(buyHouses.getProcessStatus())
|
||||
&& !Constants.SUBMIT.equals(buyHouses.getProcessStatus())
|
||||
&& ! Constants.FAILD.equals(buyHouses.getProcessStatus())){
|
||||
return R.fail("当前状态不在修改范围");
|
||||
throw new ServiceException("当前状态不在修改范围");
|
||||
// return R.fail("当前状态不在修改范围");
|
||||
}
|
||||
buyHouses.setId(buyHouses1.getId());
|
||||
//判断该人才是否存在
|
||||
if (ObjectUtil.isEmpty(buyHouses1.getApiKey()) || !buyHouses1.getUserId().equals(buyHouses.getUserId())){
|
||||
return R.fail("当前用户已在系统存在");
|
||||
}
|
||||
|
||||
//判断当前是否可以提交
|
||||
if (Constants.WAIT.equals(buyHouses1.getProcessStatus())
|
||||
||Constants.SUCCEED.equals(buyHouses1.getProcessStatus())){
|
||||
return R.fail("当前状态不允许修改");
|
||||
throw new ServiceException("当前状态不允许修改");
|
||||
// return R.fail("当前状态不允许修改");
|
||||
}
|
||||
buyHouses.setUpdateTime(new Date());
|
||||
//删除关系表中得数据
|
||||
@ -798,7 +802,8 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
//修改数据
|
||||
int i = baseMapper.updateById(buyHouses);
|
||||
if (Constants.WAIT.equals(buyHouses.getProcessStatus()) && i==0){
|
||||
return R.fail("修改失败");
|
||||
throw new ServiceException("修改失败");
|
||||
// return R.fail("修改失败");
|
||||
}
|
||||
//修改材料表中得数据
|
||||
List<BuyHousesMember> buyHousesMemberList = buyHouses.getBuyHousesMemberList();
|
||||
@ -1303,7 +1308,7 @@ public class BuyHousesServiceImpl implements IBuyHousesService {
|
||||
//对每一个HouseId分组
|
||||
Map<String, List<BuyHousesMember>> buyHousesMemberMap = buyHousesMemberList.stream().collect(Collectors.groupingBy(BuyHousesMember::getBuyHousesId));
|
||||
buyHousesVoList.stream().forEach(r -> {
|
||||
String dir="D:\\gaoxin\\images\\house\\";
|
||||
String dir="/usr/local/images/2023/07/01";
|
||||
//护照或者身份证
|
||||
if (ObjectUtil.isNotEmpty(r.getInsidepageUrl())){
|
||||
String insidepageUrl = r.getInsidepageUrl();
|
||||
|
||||
@ -58,6 +58,7 @@ public class SubscribeExportServiceImpl implements ISubscribeExportService {
|
||||
@Override
|
||||
public TableDataInfo<SubscribeExportVo> queryPageList(SubscribeExportBo bo, PageQuery pageQuery) {
|
||||
bo.setUserId(LoginHelper.getUserId().toString());
|
||||
bo.setExportStatus("1");
|
||||
LambdaQueryWrapper<SubscribeExport> lqw = buildQueryWrapper(bo);
|
||||
lqw.orderByDesc(SubscribeExport::getCreateTime);
|
||||
Page<SubscribeExportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user