|
@@ -123,8 +123,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入正确的手机号");
|
|
|
}
|
|
|
|
|
|
- //TODO 测试注释了图形验证和短信验证,后面要开启
|
|
|
- // verFacade.verifyImgVerification(imgVerVerVO); //保存时再次校验图形验证码,主要是为了防止跳过前端校验直接调用接口
|
|
|
+ verFacade.verifyImgVerification(imgVerVerVO); //保存时再次校验图形验证码,主要是为了防止跳过前端校验直接调用接口
|
|
|
|
|
|
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
|
|
String entryPassword = passwordEncoder.encode(user.getPassword());
|
|
@@ -144,12 +143,12 @@ public class UserFacade extends UserServiceImpl {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 校验用户(手机号)是否注册
|
|
|
+ * 校验用户(手机号)未注册
|
|
|
*
|
|
|
* @param usernameVO 参数
|
|
|
* @return 返回状态
|
|
|
*/
|
|
|
- public Boolean verifyUser(UsernameVO usernameVO) {
|
|
|
+ public Boolean verifyNoUser(UsernameVO usernameVO) {
|
|
|
String username = usernameVO.getUsername();
|
|
|
if(StringUtil.isEmpty(username)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入手机号");
|
|
@@ -165,6 +164,28 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 校验用户(手机号)已注册
|
|
|
+ *
|
|
|
+ * @param usernameVO 参数
|
|
|
+ * @return 返回状态
|
|
|
+ */
|
|
|
+ public Boolean verifyExistUser(UsernameVO usernameVO) {
|
|
|
+ String username = usernameVO.getUsername();
|
|
|
+ if(StringUtil.isEmpty(username)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入手机号");
|
|
|
+ }
|
|
|
+ if(!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入正确的手机号");
|
|
|
+ }
|
|
|
+ User bean = findByName(username);
|
|
|
+ if (bean == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该手机未注册");
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param page 分页参数
|
|
|
* @param userSaveVO 参数
|
|
@@ -782,13 +803,14 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 添加机构信息
|
|
|
* @param organizationVO
|
|
|
* @return
|
|
|
*/
|
|
|
public RespDTO<Boolean> addOrganizations(OrganizationVO organizationVO) {
|
|
|
|
|
|
String organizationName = organizationVO.getOrganizationName();
|
|
|
- List<Organization> organizationList = organizationFacade.findOrganization(organizationName);
|
|
|
+ List<Organization> organizationList = organizationFacade.findOrganizationAll(organizationName);
|
|
|
if (ListUtil.isNotEmpty(organizationList)) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "该机构存在");
|
|
|
}
|
|
@@ -811,8 +833,9 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 添加用户信息和机构信息管理员
|
|
|
* @param userAndOrganizationVO
|
|
|
- * @return 添加用户信息和机构信息管理员
|
|
|
+ * @return
|
|
|
*/
|
|
|
public RespDTO<Boolean> addUserInfos(UserAndOrganizationVO userAndOrganizationVO) {
|
|
|
// TODO 先查找机构,获取机构id,再注册用户,返回用户id, 取到用户id和 机构id ,查询用户机构关联表,在进行绑定
|
|
@@ -865,6 +888,14 @@ public class UserFacade extends UserServiceImpl {
|
|
|
userOrganization.setUserId(userId);// 用户id
|
|
|
|
|
|
res = userOrganizationFacade.save(userOrganization);
|
|
|
+
|
|
|
+ UserRole userRole = new UserRole();
|
|
|
+ userRole.setUserId(user.getId());
|
|
|
+ userRole.setRoleId(1L);
|
|
|
+ userRole.setGmtCreate(new Date());
|
|
|
+ userRole.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
+ userRoleFacade.save(userRole);
|
|
|
+
|
|
|
} else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED);
|
|
|
}
|
|
@@ -939,10 +970,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
* @param autStatus
|
|
|
* @return
|
|
|
*/
|
|
|
- public RespDTO<IPage<UserAllDTO>> queryUserInformations(Page page, String orgName, Integer autStatus,String startTime,String endTime){
|
|
|
+ public RespDTO<IPage<UserAllDTO>> queryUserInformations(Page page, String userName, Integer autStatus,String startTime,String endTime){
|
|
|
CustomerDTO userInfo = new CustomerDTO();
|
|
|
- if(orgName != null && orgName.length() != 0){
|
|
|
- userInfo.setOrgName(orgName);
|
|
|
+ if(userName != null && userName.length() != 0){
|
|
|
+ userInfo.setUserName(userName);
|
|
|
}
|
|
|
if(!autStatus.equals("")){
|
|
|
userInfo.setAutStatus(autStatus);
|
|
@@ -1055,7 +1086,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 用户信息
|
|
|
+ * 导出用户信息
|
|
|
* @param userExportVO
|
|
|
* @param response
|
|
|
*/
|
|
@@ -1112,10 +1143,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
userMap.put("startTime", userExportVO.getStartTime());
|
|
|
userMap.put("endTime", userExportVO.getEndTime());
|
|
|
- userMap.put("autStatus",userExportVO.getAutStatus());
|
|
|
+ /*userMap.put("autStatus",userExportVO.getAutStatus());*/
|
|
|
userMap.put("orgName",userExportVO.getOrgName());
|
|
|
- userMap.put("userName",userExportVO.getUserName());
|
|
|
- List<UserInfoDTO> datas = dependentuserInfoByTime(userMap);
|
|
|
+ /*userMap.put("userName",userExportVO.getUserName());*/
|
|
|
+ List<UserInfoDTO> datas = exportOrganizations(userMap);
|
|
|
GsonUtil.toJson(datas);
|
|
|
List<String> listName = new ArrayList<>();
|
|
|
|
|
@@ -1152,7 +1183,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
|
|
|
- ex.exportExcelNew("用户信息详情", listName, listId, list,response);
|
|
|
+ ex.exportExcelNew("机构信息详情", listName, listId, list,response);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1251,18 +1282,13 @@ public class UserFacade extends UserServiceImpl {
|
|
|
userInfo.getEmail(),
|
|
|
AuthStatusEnum.getName(userInfo.getAutStatus())));
|
|
|
}
|
|
|
- //response.setContentType("text/html;charset=UTF-8");
|
|
|
- /* String filePath = userExportVO.getFilePath();//文件路径
|
|
|
- String fileName = userExportVO.getFileName();//文件名
|
|
|
- ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
|
|
|
- RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list, filePath, fileName);*/
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
|
|
|
- ex.exportExcelNew("用户信息详情", listName, listId, list,response);
|
|
|
+ ex.exportExcelNew("已认证用户信息", listName, listId, list,response);
|
|
|
|
|
|
}
|
|
|
|
|
|
- //超管修改用户信息
|
|
|
+ //超管修改用户信息接口
|
|
|
public RespDTO<Boolean> updateUserInfos(AmendUserInfoVO amendUserInfoVO) {
|
|
|
Map<String, Object> amendUserInfo = new HashMap<String, Object>();
|
|
|
amendUserInfo.put("modifier", UserUtils.getCurrentPrincipleID());
|