|
@@ -21,6 +21,7 @@ import com.diagbot.dto.UserAndProdutDTO;
|
|
|
import com.diagbot.dto.UserInfoDTO;
|
|
|
import com.diagbot.dto.UserInfoExportDTO;
|
|
|
import com.diagbot.dto.UserLoginDTO;
|
|
|
+import com.diagbot.dto.UserNameDTO;
|
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
|
import com.diagbot.dto.UserOrgizationProductDTO;
|
|
|
import com.diagbot.entity.JWT;
|
|
@@ -819,8 +820,8 @@ public class UserFacade extends UserServiceImpl {
|
|
|
auditMap.put("gmtModified", DateUtil.now());
|
|
|
auditMap.put("certificationDate", DateUtil.now());
|
|
|
User userDate = getById(userInfoAuditVO.getUserId());
|
|
|
- if(!userDate.getAuthStatus().equals(2)){
|
|
|
- return RespDTO.onError("该用户已被操作");
|
|
|
+ if (!userDate.getAuthStatus().equals(2)) {
|
|
|
+ return RespDTO.onError("该用户已被操作");
|
|
|
}
|
|
|
if (ByType == 1) {
|
|
|
auditMap.put("isReject", RejectEnum.PASS.getKey());
|
|
@@ -904,7 +905,7 @@ public class UserFacade extends UserServiceImpl {
|
|
|
User user = new User();
|
|
|
user.setCreator(UserUtils.getCurrentPrincipleID());//创建id
|
|
|
user.setUsername(userAndOrganizationVO.getUserName());//用户账号
|
|
|
- String password= DigestUtils.md5Hex(userAndOrganizationVO.getPassWord());
|
|
|
+ String password = DigestUtils.md5Hex(userAndOrganizationVO.getPassWord());
|
|
|
//System.out.println(password);
|
|
|
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
|
|
String entryPassword = passwordEncoder.encode(password);
|
|
@@ -960,10 +961,10 @@ public class UserFacade extends UserServiceImpl {
|
|
|
map.put("userId", baseIdVO.getId());
|
|
|
map.put("modifier", UserUtils.getCurrentPrincipleID());
|
|
|
map.put("gmtModified", DateUtil.now());
|
|
|
- User userDate = getById(baseIdVO.getId());
|
|
|
- if(userDate.getIsDeleted().equals("Y")){
|
|
|
- return RespDTO.onError("该用户已不存在");
|
|
|
- }
|
|
|
+ User userDate = getById(baseIdVO.getId());
|
|
|
+ if (userDate.getIsDeleted().equals("Y")) {
|
|
|
+ return RespDTO.onError("该用户已不存在");
|
|
|
+ }
|
|
|
//客户中心-查询用户续费数量
|
|
|
RespDTO<Integer> renewalSums = diagbotmanClient.getUserWaitingRenewal(baseIdVO.getId());
|
|
|
if (renewalSums == null || !"0".equals(renewalSums.code)) {
|
|
@@ -972,9 +973,9 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
int renewalSum = renewalSums.data;
|
|
|
//System.out.println("========renewalSu====="+renewalSum);
|
|
|
- if(renewalSum>0){
|
|
|
- return RespDTO.onError("该用户无法删除,请先处理产品申请信息");
|
|
|
- }
|
|
|
+ if (renewalSum > 0) {
|
|
|
+ return RespDTO.onError("该用户无法删除,请先处理产品申请信息");
|
|
|
+ }
|
|
|
//查询用户是否有待审核的产品数量
|
|
|
RespDTO<Integer> auditSums = diagbotmanClient.getOrderByUserToAudit(baseIdVO.getId());
|
|
|
if (auditSums == null || !"0".equals(auditSums.code)) {
|
|
@@ -983,25 +984,25 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
int auditSum = auditSums.data;
|
|
|
//System.out.println("=========auditSumauditSum===="+auditSum);
|
|
|
- if(auditSum>0){
|
|
|
- return RespDTO.onError("该用户存在产品申请单,请先审核");
|
|
|
- }
|
|
|
+ if (auditSum > 0) {
|
|
|
+ return RespDTO.onError("该用户存在产品申请单,请先审核");
|
|
|
+ }
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
userIds.add(baseIdVO.getId());
|
|
|
RespDTO<List<UserAndProdutDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
|
|
|
-
|
|
|
- if (InformationData == null || !"0".equals(InformationData.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "获取所有开通信息失败");
|
|
|
- }
|
|
|
- //获取该用户开通的产品信息的状态
|
|
|
- List<UserAndProdutDTO> dataList = InformationData.data;
|
|
|
- for(UserAndProdutDTO InformationDataNew :dataList){
|
|
|
- Integer serviceStatus =InformationDataNew.getServiceStatus();
|
|
|
- if(serviceStatus.equals(StatusEnum.Enable.getKey())){
|
|
|
- return RespDTO.onError("请先停用所有产品");
|
|
|
- }
|
|
|
+
|
|
|
+ if (InformationData == null || !"0".equals(InformationData.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取所有开通信息失败");
|
|
|
+ }
|
|
|
+ //获取该用户开通的产品信息的状态
|
|
|
+ List<UserAndProdutDTO> dataList = InformationData.data;
|
|
|
+ for (UserAndProdutDTO InformationDataNew : dataList) {
|
|
|
+ Integer serviceStatus = InformationDataNew.getServiceStatus();
|
|
|
+ if (serviceStatus.equals(StatusEnum.Enable.getKey())) {
|
|
|
+ return RespDTO.onError("请先停用所有产品");
|
|
|
}
|
|
|
+ }
|
|
|
boolean res = updateDeleted(map);
|
|
|
if (!res) {
|
|
|
throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
|
|
@@ -1403,8 +1404,8 @@ public class UserFacade extends UserServiceImpl {
|
|
|
amendUserInfo.put("position", amendUserInfoVO.getPosition());
|
|
|
amendUserInfo.put("linkman", amendUserInfoVO.getLinkman());
|
|
|
User userDate = getById(amendUserInfoVO.getUserId());
|
|
|
- if(userDate.getIsDeleted().equals("Y")){
|
|
|
- return RespDTO.onError("该用户已不存在");
|
|
|
+ if (userDate.getIsDeleted().equals("Y")) {
|
|
|
+ return RespDTO.onError("该用户已不存在");
|
|
|
}
|
|
|
boolean res = updateUserInfo(amendUserInfo);
|
|
|
if (!res) {
|
|
@@ -1433,4 +1434,15 @@ public class UserFacade extends UserServiceImpl {
|
|
|
return RespDTO.onSuc(this.getById(userId));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据用户ID列表获取用户数据
|
|
|
+ *
|
|
|
+ * @param ids 用户ID列表
|
|
|
+ * @return 用户名信息列表
|
|
|
+ */
|
|
|
+ public List<UserNameDTO> getUserInfoByIds(List<Long> ids) {
|
|
|
+ List<User> userList = this.getByIds(ids);
|
|
|
+ List<UserNameDTO> res = BeanUtil.listCopyTo(userList, UserNameDTO.class);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|