|
@@ -24,16 +24,53 @@ import com.xjrsoft.common.utils.RedisUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.config.CommonPropertiesConfig;
|
|
import com.xjrsoft.config.CommonPropertiesConfig;
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
-import com.xjrsoft.module.organization.dto.*;
|
|
|
|
-import com.xjrsoft.module.organization.entity.*;
|
|
|
|
-import com.xjrsoft.module.organization.service.*;
|
|
|
|
|
|
+import com.xjrsoft.module.organization.dto.AddUserDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.BindOpenidDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.RegisterDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.ResetPasswordDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UpdateInfoDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UpdatePasswordDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UpdateUserDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UserPageDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UserStudentAddDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UserStudentBindDto;
|
|
|
|
+import com.xjrsoft.module.organization.dto.UserStudentDeleteDto;
|
|
|
|
+import com.xjrsoft.module.organization.entity.Department;
|
|
|
|
+import com.xjrsoft.module.organization.entity.Post;
|
|
|
|
+import com.xjrsoft.module.organization.entity.Role;
|
|
|
|
+import com.xjrsoft.module.organization.entity.User;
|
|
|
|
+import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
|
+import com.xjrsoft.module.organization.entity.UserPostRelation;
|
|
|
|
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
|
+import com.xjrsoft.module.organization.service.IDepartmentService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IPostService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IRoleService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IUserDeptRelationService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IUserPostRelationService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IUserRoleRelationService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IUserService;
|
|
|
|
+import com.xjrsoft.module.organization.service.IUserStudentService;
|
|
import com.xjrsoft.module.organization.utils.OrganizationUtil;
|
|
import com.xjrsoft.module.organization.utils.OrganizationUtil;
|
|
-import com.xjrsoft.module.organization.vo.*;
|
|
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserDeptVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserInfoVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserListVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserPageVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserPostVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserRoleVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserStudentVo;
|
|
|
|
+import com.xjrsoft.module.organization.vo.UserVo;
|
|
import com.xjrsoft.module.oss.factory.OssFactory;
|
|
import com.xjrsoft.module.oss.factory.OssFactory;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
@@ -369,11 +406,22 @@ public class UserController {
|
|
if (StrUtil.isNotBlank(user.getUnionId())) {
|
|
if (StrUtil.isNotBlank(user.getUnionId())) {
|
|
return R.error("该用户已经绑定微信!");
|
|
return R.error("该用户已经绑定微信!");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
|
|
|
|
+ if(count > 0){
|
|
|
|
+ return R.error("该用户已经绑定微信!");
|
|
|
|
+ }
|
|
|
|
+
|
|
User updateUser = new User();
|
|
User updateUser = new User();
|
|
updateUser.setId(dto.getId());
|
|
updateUser.setId(dto.getId());
|
|
// updateUser.setOpenId(dto.getOpenid());
|
|
// updateUser.setOpenId(dto.getOpenid());
|
|
updateUser.setUnionId(dto.getOpenid());
|
|
updateUser.setUnionId(dto.getOpenid());
|
|
return R.ok(userService.updateById(updateUser));
|
|
return R.ok(userService.updateById(updateUser));
|
|
|
|
+ }else{
|
|
|
|
+ long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
|
|
|
|
+ if(count > 0){
|
|
|
|
+ return R.error("该用户已经绑定微信!");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return R.error("该用户不存在!");
|
|
return R.error("该用户不存在!");
|
|
}
|
|
}
|
|
@@ -383,7 +431,7 @@ public class UserController {
|
|
public R unbindOpenid(@RequestParam Long id) {
|
|
public R unbindOpenid(@RequestParam Long id) {
|
|
User updateUser = new User();
|
|
User updateUser = new User();
|
|
updateUser.setId(id);
|
|
updateUser.setId(id);
|
|
-// updateUser.setOpenId("");
|
|
|
|
|
|
+ updateUser.setOpenId("");
|
|
updateUser.setUnionId("");
|
|
updateUser.setUnionId("");
|
|
return R.ok(userService.updateById(updateUser));
|
|
return R.ok(userService.updateById(updateUser));
|
|
}
|
|
}
|