add:修改授权码
This commit is contained in:
-2
@@ -63,8 +63,6 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
|
||||
@Autowired
|
||||
private IPayCaseCommitteeSubitemService payCaseCommitteeSubitemService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分标委表-企业端分页列表查询
|
||||
*
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.jero.data.entity;
|
||||
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@Data
|
||||
public class RegisterSelf {
|
||||
/**手机号*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空!")
|
||||
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号码格式错误")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@NotEmpty(message = "密码不能为空!")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
@ApiModelProperty(value = "确认密码")
|
||||
@NotEmpty(message = "确认密码不能为空!")
|
||||
private String verifyPassword;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
@ApiModelProperty(value = "验证码")
|
||||
@NotEmpty(message = "验证码不能为空!")
|
||||
private String verifyCode;
|
||||
|
||||
@ApiModelProperty(value = "RSA公钥")
|
||||
@NotEmpty(message = "RSA公钥不能为空!")
|
||||
private String rsaPublicKey;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "个人信息")
|
||||
private PayContactsManagement payContactsManagement;
|
||||
|
||||
}
|
||||
+7
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.data.entity.DetailForCaseCommittee;
|
||||
import com.jero.data.entity.PayCaseCommittee;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.data.entity.RegisterSelf;
|
||||
|
||||
/**
|
||||
* @Description: pay_case_committee
|
||||
@@ -32,4 +33,10 @@ public interface IPayCaseCommitteeService extends IService<PayCaseCommittee> {
|
||||
* @return
|
||||
*/
|
||||
DetailForCaseCommittee detail(String id,String userId);
|
||||
|
||||
|
||||
void registerSelf(RegisterSelf registerSelf);
|
||||
|
||||
void modify(String id, String emailPassword);
|
||||
|
||||
}
|
||||
|
||||
+56
-1
@@ -4,11 +4,18 @@ package com.jero.data.service.impl;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.CommonUtils;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.data.entity.DetailForCaseCommittee;
|
||||
import com.jero.data.entity.PayCaseCommittee;
|
||||
import com.jero.data.entity.RegisterSelf;
|
||||
import com.jero.data.mapper.PayCaseCommitteeMapper;
|
||||
import com.jero.data.mapper.PayCaseCommitteeSubitemMapper;
|
||||
import com.jero.data.service.IPayCaseCommitteeService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -23,9 +30,15 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@Service
|
||||
public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMapper, PayCaseCommittee> implements IPayCaseCommitteeService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private PayCaseCommitteeMapper payCaseCommitteeMapper;
|
||||
@Resource
|
||||
private IPayContactsManagementService payContactsManagementService;
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 企业端分标委列表
|
||||
* @param page
|
||||
@@ -47,4 +60,46 @@ public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMap
|
||||
public DetailForCaseCommittee detail(String id,String userId) {
|
||||
return payCaseCommitteeMapper.detail(id,userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSelf(RegisterSelf registerSelf) {
|
||||
//前端传入密码解密
|
||||
String phone = registerSelf.getPhone();
|
||||
String password = registerSelf.getPassword();
|
||||
String verifyPassword = registerSelf.getVerifyPassword();
|
||||
String RSAPublicKey = registerSelf.getRsaPublicKey();
|
||||
String RSAPrivateKey = String.valueOf(redisUtil.get(RSAPublicKey));
|
||||
try {
|
||||
password = CommonUtils.decryptBtRsaPriKey(password, RSAPrivateKey);
|
||||
verifyPassword = CommonUtils.decryptBtRsaPriKey(verifyPassword, RSAPrivateKey);
|
||||
registerSelf.setPassword(password);
|
||||
registerSelf.setVerifyPassword(verifyPassword);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//处理手机获取验证码的逻辑
|
||||
Object obj = redisUtil.get("_verification:_phone:" + phone);
|
||||
if (obj == null) {
|
||||
throw new JeroBootException("验证码失效,请重新发送");
|
||||
}
|
||||
String code = obj.toString();
|
||||
if (!registerSelf.getVerifyCode().equals(code)) {
|
||||
throw new JeroBootException("验证码错误!");
|
||||
}
|
||||
|
||||
if (!password.equals(verifyPassword)) {
|
||||
throw new JeroBootException("新密码和确认密码不一致,请重新输入");
|
||||
}
|
||||
payContactsManagementService.addMeeting(registerSelf.getPayContactsManagement());
|
||||
redisUtil.del("_verification:_phone:" + phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify(String id, String emailPassword) {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setId(id);
|
||||
sysUser.setEmailPassword(emailPassword);
|
||||
sysUserService.updateById(sysUser);
|
||||
}
|
||||
}
|
||||
|
||||
+23
-3
@@ -2,16 +2,19 @@ package com.jero.home.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.data.entity.RegisterSelf;
|
||||
import com.jero.data.service.IPayCaseCommitteeService;
|
||||
import com.jero.home.vo.DataStatisticsVO;
|
||||
import com.jero.mail.service.IPayMailBillService;
|
||||
import com.jero.payment.service.IPayPaymentRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
@@ -38,6 +41,8 @@ public class HomeController {
|
||||
private IPayMailBillService payMailBillService;
|
||||
@Resource
|
||||
private ProjectDetailService projectDetailService;
|
||||
@Autowired
|
||||
private IPayCaseCommitteeService payCaseCommitteeService;
|
||||
|
||||
/**
|
||||
* 首页-数据统计
|
||||
@@ -72,4 +77,19 @@ public class HomeController {
|
||||
dataStatisticsVO.setNowMonthMail(m);
|
||||
return Result.OK(dataStatisticsVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "注册个人")
|
||||
@PostMapping(value = "/registerSelf")
|
||||
public Result<?> registerSelf(@Valid @RequestBody RegisterSelf registerSelf) {
|
||||
payCaseCommitteeService.registerSelf(registerSelf);
|
||||
return Result.OK("注册成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改授权码")
|
||||
@PostMapping(value = "/modify")
|
||||
public Result<?> modify(@RequestParam(value = "id",required = true)String id,
|
||||
@RequestParam(value = "emailPassword",required = true)String emailPassword) {
|
||||
payCaseCommitteeService.modify(id,emailPassword);
|
||||
return Result.OK("修改成功");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user