add:修改授权码
This commit is contained in:
+3
@@ -107,6 +107,7 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/company/WCLogin", "anon");//微信登录
|
||||
filterChainDefinitionMap.put("/company/jscode2session", "anon");//微信登录凭证校验
|
||||
|
||||
|
||||
//和会员系统交互的接口
|
||||
//filterChainDefinitionMap.put("/meeting/payMeeting/addStandards","anon");//会员系统推送会议
|
||||
//filterChainDefinitionMap.put("/meeting/payMeeting/addStandardsFile","anon");//会员系统推送文件
|
||||
@@ -174,6 +175,8 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/company/payContactsManagement/addMeeting","anon");
|
||||
filterChainDefinitionMap.put("/company/payContactsManagement/queryByIdMeeting","anon");
|
||||
filterChainDefinitionMap.put("/company/payContactsManagement/queryWXByCompany","anon");
|
||||
//企业端注册个人
|
||||
filterChainDefinitionMap.put("/home/registerSelf", "anon");
|
||||
|
||||
|
||||
|
||||
|
||||
-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("修改成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,5 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
+5
-5
@@ -6,8 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.entity.SysUserRole;
|
||||
import com.jero.modules.system.entity.*;
|
||||
import com.jero.modules.system.model.SysLoginVO;
|
||||
import com.jero.modules.system.service.*;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -24,8 +23,6 @@ import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.*;
|
||||
import com.jero.common.util.encryption.EncryptedString;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.SysLoginModel;
|
||||
import com.jero.modules.system.util.RandImageUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -36,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -459,6 +457,7 @@ public class LoginController {
|
||||
obj.put("multi_depart", 2);
|
||||
}
|
||||
sysUser.setPhone(PasswordUtil.decrypt(sysUser.getPhone()));
|
||||
sysUser.setEmail(PasswordUtil.decrypt(sysUser.getEmail()));
|
||||
obj.put("token", token);
|
||||
obj.put("userInfo", sysUser);
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
@@ -628,6 +627,7 @@ public class LoginController {
|
||||
return Result.OK("修改密码成功");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "发送手机号验证码")
|
||||
@GetMapping(value = "/sendVerificationCode")
|
||||
public Result<?> sendVerificationCode(@RequestParam(name="phone") String phone,
|
||||
@@ -643,4 +643,4 @@ public class LoginController {
|
||||
String string = redisUtil.get("_verification:_phone:" + phone).toString();
|
||||
return Result.OK(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-8
@@ -62,17 +62,17 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
public boolean deleteBatchUsers(String userIds);
|
||||
|
||||
|
||||
public SysUser getUserByName(String username);
|
||||
|
||||
|
||||
/**
|
||||
* 添加用户和用户角色关系
|
||||
* @param user
|
||||
* @param roles
|
||||
*/
|
||||
public void addUserWithRole(SysUser user,String roles);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户和用户角色关系
|
||||
* @param user
|
||||
@@ -86,7 +86,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
public List<String> getRole(String username);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户信息包括 部门信息
|
||||
* @param username
|
||||
@@ -157,14 +157,14 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return 权限集合
|
||||
*/
|
||||
Set<String> getUserPermissionsSet(String username);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名设置部门ID
|
||||
* @param username
|
||||
* @param orgCode
|
||||
*/
|
||||
void updateUserDepart(String username,String orgCode);
|
||||
|
||||
|
||||
/**
|
||||
* 根据手机号获取用户名和密码
|
||||
*/
|
||||
@@ -190,7 +190,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param departs
|
||||
*/
|
||||
void editUserWithDepart(SysUser user, String departs);
|
||||
|
||||
|
||||
/**
|
||||
* 校验用户是否有效
|
||||
* @param sysUser
|
||||
@@ -259,4 +259,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return PayContactsManagement
|
||||
*/
|
||||
PayContactsManagement getPayContactsManagementByPhone(String phone);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+18
-16
@@ -47,24 +47,24 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
|
||||
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysPermissionMapper sysPermissionMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysUserRoleMapper sysUserRoleMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysUserDepartMapper sysUserDepartMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysDepartMapper sysDepartMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysRoleMapper sysRoleMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysDepartRoleUserMapper departRoleUserMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysDepartRoleMapper sysDepartRoleMapper;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
@@ -126,8 +126,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
public SysUser getUserByName(String username) {
|
||||
return userMapper.getUserByName(username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void addUserWithRole(SysUser user, String roles) {
|
||||
@@ -162,7 +162,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
public List<String> getRole(String username) {
|
||||
return sysUserRoleMapper.getRoleByUserName(username);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过用户名获取用户角色集合
|
||||
* @param username 用户名
|
||||
@@ -206,7 +206,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
// SysUser user = userMapper.getUserByName(username);
|
||||
// info.setSysUserCode(user.getUsername());
|
||||
// info.setSysUserName(user.getRealname());
|
||||
|
||||
|
||||
|
||||
LoginUser user = sysBaseAPI.getUserByName(username);
|
||||
if(user!=null) {
|
||||
@@ -214,7 +214,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
info.setSysUserName(user.getRealname());
|
||||
info.setSysOrgCode(user.getOrgCode());
|
||||
}
|
||||
|
||||
|
||||
//多部门支持in查询
|
||||
List<SysDepart> list = sysDepartMapper.queryUserDeparts(user.getId());
|
||||
List<String> sysMultiOrgCode = new ArrayList<String>();
|
||||
@@ -230,7 +230,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
}
|
||||
info.setSysMultiOrgCode(sysMultiOrgCode);
|
||||
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -564,6 +564,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
return userMapper.getPayContactsManagementByPhone(phone);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 忘记密码校验
|
||||
* @param user
|
||||
|
||||
Reference in New Issue
Block a user