|
@@ -110,7 +110,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
private VisibleIdCreater visibleIdCreater;
|
|
|
@Autowired
|
|
|
private TokenFacade tokenFacade;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 注册
|
|
@@ -160,10 +160,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
*/
|
|
|
public Boolean verifyNoUser(UsernameVO usernameVO) {
|
|
|
String username = usernameVO.getUsername();
|
|
|
- if(StringUtil.isEmpty(username)) {
|
|
|
+ if (StringUtil.isEmpty(username)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入手机号");
|
|
|
}
|
|
|
- if(!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
+ if (!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入正确的手机号");
|
|
|
}
|
|
|
User bean = findByName(username);
|
|
@@ -174,7 +174,6 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 校验用户(手机号)已注册
|
|
|
*
|
|
@@ -183,10 +182,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
*/
|
|
|
public Boolean verifyExistUser(UsernameVO usernameVO) {
|
|
|
String username = usernameVO.getUsername();
|
|
|
- if(StringUtil.isEmpty(username)) {
|
|
|
+ if (StringUtil.isEmpty(username)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入手机号");
|
|
|
}
|
|
|
- if(!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
+ if (!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入正确的手机号");
|
|
|
}
|
|
|
User bean = findByName(username);
|
|
@@ -344,7 +343,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
* 修改朗通后台个人信息
|
|
|
*/
|
|
|
public void updatePersonInfo(PersonVO personVO) {
|
|
|
- if(!RegexValidateUtil.checkMobileNumber(personVO.getPhone())) {
|
|
|
+ if (!RegexValidateUtil.checkMobileNumber(personVO.getPhone())) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"请输入正确的手机号");
|
|
|
}
|
|
@@ -418,6 +417,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
//验证刷新令牌有效性
|
|
|
+ if (!tokenFacade.verifyToken(refreshToken, 2)) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
|
|
|
+ "不是被允许的刷新令牌");
|
|
|
+ }
|
|
|
|
|
|
JWT jwt = authServiceClient.refreshToken("Basic dWFhLXNlcnZpY2U6MTIzNDU2", "refresh_token", refreshToken);
|
|
|
if (null == jwt) {
|
|
@@ -558,7 +561,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
/**
|
|
|
* 修改密码
|
|
|
*
|
|
|
- * @param password 原密码
|
|
|
+ * @param password 原密码
|
|
|
* @param modifyPassword 新密码
|
|
|
* @return 修改密码是否成功
|
|
|
*/
|
|
@@ -571,7 +574,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
|
|
|
"请输入新密码");
|
|
|
}
|
|
|
- if(password.equals(modifyPassword)) {
|
|
|
+ if (password.equals(modifyPassword)) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
|
|
|
"原密码和新密码不能相同");
|
|
|
}
|
|
@@ -702,16 +705,15 @@ public class UserFacade extends UserServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* @param userExportVO
|
|
|
- * @return
|
|
|
* @return 导出Excel文件
|
|
|
*/
|
|
|
- public void export(UserExportVO userExportVO,HttpServletResponse response) {
|
|
|
+ public void export(UserExportVO userExportVO, HttpServletResponse response) {
|
|
|
Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
userMap.put("startTime", userExportVO.getStartTime());
|
|
|
userMap.put("endTime", userExportVO.getEndTime());
|
|
|
- userMap.put("authStatus",userExportVO.getAuthStatus());
|
|
|
- userMap.put("orgName",userExportVO.getOrgName());
|
|
|
- userMap.put("userName",userExportVO.getUserName());
|
|
|
+ userMap.put("authStatus", userExportVO.getAuthStatus());
|
|
|
+ userMap.put("orgName", userExportVO.getOrgName());
|
|
|
+ userMap.put("userName", userExportVO.getUserName());
|
|
|
List<UserInfoDTO> datas = dependentuserInfoByTime(userMap);
|
|
|
GsonUtil.toJson(datas);
|
|
|
List<String> listName = new ArrayList<>();
|
|
@@ -776,7 +778,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -806,27 +808,27 @@ public class UserFacade extends UserServiceImpl {
|
|
|
* @param userInfoAuditVO
|
|
|
* @return 审核用户信息和机构信息
|
|
|
*/
|
|
|
- public RespDTO<Boolean> auditUserInfoAlls(UserInfoAuditVO userInfoAuditVO,int ByType) {
|
|
|
+ public RespDTO<Boolean> auditUserInfoAlls(UserInfoAuditVO userInfoAuditVO, int ByType) {
|
|
|
Map<String, Object> auditMap = new HashMap<String, Object>();
|
|
|
auditMap.put("orderNum", userInfoAuditVO.getOrderNum());
|
|
|
auditMap.put("userId", userInfoAuditVO.getUserId());
|
|
|
auditMap.put("modifier", UserUtils.getCurrentPrincipleID());
|
|
|
auditMap.put("gmtModified", DateUtil.now());
|
|
|
auditMap.put("certificationDate", DateUtil.now());
|
|
|
- if(ByType == 1){
|
|
|
- auditMap.put("isReject", RejectEnum.PASS.getKey());
|
|
|
+ if (ByType == 1) {
|
|
|
+ auditMap.put("isReject", RejectEnum.PASS.getKey());
|
|
|
}
|
|
|
- if(ByType == 2){
|
|
|
+ if (ByType == 2) {
|
|
|
auditMap.put("isReject", RejectEnum.NO_PASS.getKey());
|
|
|
- }
|
|
|
+ }
|
|
|
auditMap.put("rejectComment", userInfoAuditVO.getRejectComment());
|
|
|
auditMap.put("rejectType", userInfoAuditVO.getRejectType());
|
|
|
- auditMap.put("status",AuthHandleEnum.Handled.getKey());//已处理
|
|
|
- if(ByType == 1){
|
|
|
- auditMap.put("authStatus", 1);
|
|
|
+ auditMap.put("status", AuthHandleEnum.Handled.getKey());//已处理
|
|
|
+ if (ByType == 1) {
|
|
|
+ auditMap.put("authStatus", 1);
|
|
|
}
|
|
|
- if(ByType == 2){
|
|
|
- auditMap.put("authStatus", 0);
|
|
|
+ if (ByType == 2) {
|
|
|
+ auditMap.put("authStatus", 0);
|
|
|
}
|
|
|
// TODO 审核前先验证该用户的的认证状态
|
|
|
boolean res = auditUserInfoAll(auditMap);
|
|
@@ -838,6 +840,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 添加机构信息
|
|
|
+ *
|
|
|
* @param organizationVO
|
|
|
* @return
|
|
|
*/
|
|
@@ -868,6 +871,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 添加用户信息和机构信息管理员
|
|
|
+ *
|
|
|
* @param userAndOrganizationVO
|
|
|
* @return
|
|
|
*/
|
|
@@ -995,69 +999,75 @@ public class UserFacade extends UserServiceImpl {
|
|
|
user.setRecords(userData);
|
|
|
return RespDTO.onSuc(user);
|
|
|
}*/
|
|
|
+
|
|
|
/**
|
|
|
* 1.分页查询注册用户信息接口 queryUserInformation
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param userName
|
|
|
* @param authStatus
|
|
|
* @return
|
|
|
*/
|
|
|
- public RespDTO<IPage<UserAllDTO>> queryUserInformations(Page page, String userName, Integer authStatus,String startTime,String endTime){
|
|
|
- CustomerDTO userInfo = new CustomerDTO();
|
|
|
- if(userName != null && userName.length() != 0){
|
|
|
- userInfo.setUserName(userName);
|
|
|
- }
|
|
|
- if(authStatus!=null){
|
|
|
+ public RespDTO<IPage<UserAllDTO>> queryUserInformations(Page page, String userName, Integer authStatus, String startTime, String endTime) {
|
|
|
+ CustomerDTO userInfo = new CustomerDTO();
|
|
|
+ if (userName != null && userName.length() != 0) {
|
|
|
+ userInfo.setUserName(userName);
|
|
|
+ }
|
|
|
+ if (authStatus != null) {
|
|
|
userInfo.setAuthStatus(authStatus);
|
|
|
}
|
|
|
- if(startTime != null && startTime.length() != 0){
|
|
|
- userInfo.setStartTime(startTime);
|
|
|
+ if (startTime != null && startTime.length() != 0) {
|
|
|
+ userInfo.setStartTime(startTime);
|
|
|
}
|
|
|
- if(endTime != null && endTime.length() != 0){
|
|
|
- userInfo.setEndTime(endTime);
|
|
|
+ if (endTime != null && endTime.length() != 0) {
|
|
|
+ userInfo.setEndTime(endTime);
|
|
|
}
|
|
|
|
|
|
- return RespDTO.onSuc(queryUserInformation(page, userInfo));
|
|
|
+ return RespDTO.onSuc(queryUserInformation(page, userInfo));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 2.分页查询机构信息接口 queryMechanismInformation
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param orgName
|
|
|
* @return
|
|
|
*/
|
|
|
- public RespDTO<IPage<OrganizationDTO>> queryMechanismInformations(Page page, String orgName,String startTime,String endTime){
|
|
|
- CustomerDTO userInfo = new CustomerDTO();
|
|
|
- if(orgName != null && orgName.length() != 0){
|
|
|
- userInfo.setOrgName(orgName);
|
|
|
- }
|
|
|
- if(startTime != null && startTime.length() != 0){
|
|
|
- userInfo.setStartTime(startTime);
|
|
|
- }
|
|
|
- if(endTime != null && endTime.length() != 0){
|
|
|
- userInfo.setEndTime(endTime);
|
|
|
- }
|
|
|
- return RespDTO.onSuc(queryMechanismInformation(page, userInfo));
|
|
|
+ public RespDTO<IPage<OrganizationDTO>> queryMechanismInformations(Page page, String orgName, String startTime, String endTime) {
|
|
|
+ CustomerDTO userInfo = new CustomerDTO();
|
|
|
+ if (orgName != null && orgName.length() != 0) {
|
|
|
+ userInfo.setOrgName(orgName);
|
|
|
+ }
|
|
|
+ if (startTime != null && startTime.length() != 0) {
|
|
|
+ userInfo.setStartTime(startTime);
|
|
|
+ }
|
|
|
+ if (endTime != null && endTime.length() != 0) {
|
|
|
+ userInfo.setEndTime(endTime);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(queryMechanismInformation(page, userInfo));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 3.分页查询已认证用户信息和机构信息及开通产品接口 queryVerifiedUserOrganizationProduct
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param orgName
|
|
|
* @param userName
|
|
|
* @return
|
|
|
*/
|
|
|
- public RespDTO<IPage<UserOrgizationProductDTO>> queryVerifiedUserOrganizationProducts(Page page,String orgName,String userName,String startTime,String endTime) {
|
|
|
- CustomerDTO userInfo = new CustomerDTO();
|
|
|
- if(userName != null && userName.length() != 0){
|
|
|
- userInfo.setUserName(userName);
|
|
|
- }
|
|
|
- if(orgName != null && orgName.length() != 0){
|
|
|
- userInfo.setOrgName(orgName);
|
|
|
- }
|
|
|
- if(startTime != null && startTime.length() != 0){
|
|
|
- userInfo.setStartTime(startTime);
|
|
|
+ public RespDTO<IPage<UserOrgizationProductDTO>> queryVerifiedUserOrganizationProducts(Page page, String orgName, String userName, String startTime, String endTime) {
|
|
|
+ CustomerDTO userInfo = new CustomerDTO();
|
|
|
+ if (userName != null && userName.length() != 0) {
|
|
|
+ userInfo.setUserName(userName);
|
|
|
}
|
|
|
- if(endTime != null && endTime.length() != 0){
|
|
|
- userInfo.setEndTime(endTime);
|
|
|
+ if (orgName != null && orgName.length() != 0) {
|
|
|
+ userInfo.setOrgName(orgName);
|
|
|
+ }
|
|
|
+ if (startTime != null && startTime.length() != 0) {
|
|
|
+ userInfo.setStartTime(startTime);
|
|
|
+ }
|
|
|
+ if (endTime != null && endTime.length() != 0) {
|
|
|
+ userInfo.setEndTime(endTime);
|
|
|
}
|
|
|
|
|
|
IPage<UserOrgizationProductDTO> user = queryVerifiedUserOrganizationProduct(page, userInfo);
|
|
@@ -1067,57 +1077,59 @@ public class UserFacade extends UserServiceImpl {
|
|
|
Long userInfoId = userInfoDTO.getUserId();
|
|
|
userIds.add(userInfoId);
|
|
|
}
|
|
|
- if(userIds.size()>0){
|
|
|
+ if (userIds.size() > 0) {
|
|
|
|
|
|
|
|
|
- RespDTO<List<UserAndProdutDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
|
|
|
+ RespDTO<List<UserAndProdutDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
|
|
|
|
|
|
- if (InformationData == null || !"0".equals(InformationData.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "获取所有开通信息失败");
|
|
|
- }
|
|
|
- Map<Long, List<UserAndProdutDTO>> map = new HashMap<>();
|
|
|
- //获取所有用户开通的产品信息
|
|
|
- List<UserAndProdutDTO> dataList = InformationData.data;
|
|
|
- map = EntityUtil.makeEntityListMap(dataList, "userId");
|
|
|
- if (map.size() > 0) {
|
|
|
- for (UserOrgizationProductDTO userInfoDTO : userData) {
|
|
|
- List<UserAndProdutDTO> userAndProdutUDTO = map.get(userInfoDTO.getUserId());
|
|
|
- if (ListUtil.isNotEmpty(userAndProdutUDTO)) {
|
|
|
- userInfoDTO.setUserAndProdutUDTO(userAndProdutUDTO);
|
|
|
+ if (InformationData == null || !"0".equals(InformationData.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取所有开通信息失败");
|
|
|
+ }
|
|
|
+ Map<Long, List<UserAndProdutDTO>> map = new HashMap<>();
|
|
|
+ //获取所有用户开通的产品信息
|
|
|
+ List<UserAndProdutDTO> dataList = InformationData.data;
|
|
|
+ map = EntityUtil.makeEntityListMap(dataList, "userId");
|
|
|
+ if (map.size() > 0) {
|
|
|
+ for (UserOrgizationProductDTO userInfoDTO : userData) {
|
|
|
+ List<UserAndProdutDTO> userAndProdutUDTO = map.get(userInfoDTO.getUserId());
|
|
|
+ if (ListUtil.isNotEmpty(userAndProdutUDTO)) {
|
|
|
+ userInfoDTO.setUserAndProdutUDTO(userAndProdutUDTO);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
//System.out.println("====================" + GsonUtil.toJson(userData));
|
|
|
user.setRecords(userData);
|
|
|
return RespDTO.onSuc(user);
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * 4.分页查询认证中的用户信息接口 queryAuthentication
|
|
|
+ * 4.分页查询认证中的用户信息接口 queryAuthentication
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param orgName
|
|
|
* @param userName
|
|
|
* @return
|
|
|
*/
|
|
|
- public RespDTO<IPage<AuthenticationDTO>> queryAuthentications(Page page,String orgName,String userName,String startTime,String endTime) {
|
|
|
- CustomerDTO userInfo = new CustomerDTO();
|
|
|
- if(userName != null && userName.length() != 0){
|
|
|
- userInfo.setUserName(userName);
|
|
|
- }
|
|
|
- if(orgName != null && orgName.length() != 0){
|
|
|
- userInfo.setOrgName(orgName);
|
|
|
- }
|
|
|
- if(startTime != null && startTime.length() != 0){
|
|
|
- userInfo.setStartTime(startTime);
|
|
|
- }
|
|
|
- if(endTime != null && endTime.length() != 0){
|
|
|
- userInfo.setEndTime(endTime);
|
|
|
+ public RespDTO<IPage<AuthenticationDTO>> queryAuthentications(Page page, String orgName, String userName, String startTime, String endTime) {
|
|
|
+ CustomerDTO userInfo = new CustomerDTO();
|
|
|
+ if (userName != null && userName.length() != 0) {
|
|
|
+ userInfo.setUserName(userName);
|
|
|
+ }
|
|
|
+ if (orgName != null && orgName.length() != 0) {
|
|
|
+ userInfo.setOrgName(orgName);
|
|
|
+ }
|
|
|
+ if (startTime != null && startTime.length() != 0) {
|
|
|
+ userInfo.setStartTime(startTime);
|
|
|
+ }
|
|
|
+ if (endTime != null && endTime.length() != 0) {
|
|
|
+ userInfo.setEndTime(endTime);
|
|
|
}
|
|
|
userInfo.setAuthStatus(2);//认证中。。。
|
|
|
userInfo.setStatus(0);//待处理
|
|
|
- return RespDTO.onSuc(queryAuthentication(page, userInfo));
|
|
|
- }
|
|
|
+ return RespDTO.onSuc(queryAuthentication(page, userInfo));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 导出用户信息
|
|
@@ -1159,7 +1171,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
List<ExportUserInfoDTO> list = new ArrayList<>();
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
UserInfoDTO userInfo = datas.get(i);
|
|
|
- list.add(new ExportUserInfoDTO(String.valueOf(i+1),
|
|
|
+ list.add(new ExportUserInfoDTO(String.valueOf(i + 1),
|
|
|
DateUtil.formatDateTime(userInfo.getUserGmtCreate()),
|
|
|
userInfo.getLinkman(),
|
|
|
AuthStatusEnum.getName(userInfo.getAuthStatus()),
|
|
@@ -1209,7 +1221,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
UserInfoDTO userInfo = datas.get(i);
|
|
|
list.add(new ExportOrganizationDTO(
|
|
|
- String.valueOf(i+1),
|
|
|
+ String.valueOf(i + 1),
|
|
|
DateUtil.formatDateTime(userInfo.getOrgGmtCreate()),
|
|
|
userInfo.getOrgName(),
|
|
|
userInfo.getOrgPrincipal(),
|
|
@@ -1259,8 +1271,8 @@ public class UserFacade extends UserServiceImpl {
|
|
|
|
|
|
List<ExportKemaDTO> list = new ArrayList<>();
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
- AuthenticationDTO userInfo = datas.get(i);
|
|
|
- list.add(new ExportKemaDTO(String.valueOf(i+1),
|
|
|
+ AuthenticationDTO userInfo = datas.get(i);
|
|
|
+ list.add(new ExportKemaDTO(String.valueOf(i + 1),
|
|
|
DateUtil.formatDateTime(userInfo.getAutGmtCreate()),
|
|
|
userInfo.getOrderNum(),
|
|
|
userInfo.getLinkman(),
|
|
@@ -1312,7 +1324,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
List<ExportVerifiedDTO> list = new ArrayList<>();
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
UserInfoDTO userInfo = datas.get(i);
|
|
|
- list.add(new ExportVerifiedDTO(String.valueOf(i+1),
|
|
|
+ list.add(new ExportVerifiedDTO(String.valueOf(i + 1),
|
|
|
DateUtil.formatDateTime(userInfo.getUserGmtCreate()),
|
|
|
DateUtil.formatDateTime(userInfo.getPassauthTime()),
|
|
|
userInfo.getLinkman(),
|
|
@@ -1360,7 +1372,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
return RespDTO.onSuc(res);
|
|
|
}
|
|
|
|
|
|
- public RespDTO<User> getUserAuthStatus(Long userId){
|
|
|
+ public RespDTO<User> getUserAuthStatus(Long userId) {
|
|
|
return RespDTO.onSuc(this.getById(userId));
|
|
|
}
|
|
|
|