This commit is contained in:
lijiaqi 2024-05-14 10:49:22 +08:00
parent d5c6b52544
commit 250386b2fa
7 changed files with 76 additions and 1 deletions

View File

@ -142,4 +142,10 @@ public class MeetingController extends BaseController {
public AjaxResult vote(@Validated @RequestBody MeetingUserVo vo) { public AjaxResult vote(@Validated @RequestBody MeetingUserVo vo) {
return meetingService.vote(vo); return meetingService.vote(vo);
} }
@GetMapping("/user")
@ApiOperation(value = "关联人员")
public AjaxResult user() {
return meetingService.user();
}
} }

View File

@ -17,6 +17,8 @@ import com.ydool.integrated.vo.MeetingVo;
import com.ydool.integrated.wrapper.MeetingWrapper; import com.ydool.integrated.wrapper.MeetingWrapper;
import com.ydool.oa.workFlow.data.entity.WorkFlowNotice; import com.ydool.oa.workFlow.data.entity.WorkFlowNotice;
import com.ydool.oa.workFlow.service.WorkFlowNoticeService; import com.ydool.oa.workFlow.service.WorkFlowNoticeService;
import com.ydool.system.entity.User;
import com.ydool.system.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -40,6 +42,9 @@ public class MeetingService extends BaseService<MeetingMapper, Meeting> {
@Autowired @Autowired
private WorkFlowNoticeService workFlowNoticeService; private WorkFlowNoticeService workFlowNoticeService;
@Autowired
private UserServiceImpl userService;
/** /**
* 校验 * 校验
* *
@ -236,5 +241,12 @@ public class MeetingService extends BaseService<MeetingMapper, Meeting> {
return AjaxResult.ok().data(MeetingWrapper.INSTANCE.toDto(pageList)); return AjaxResult.ok().data(MeetingWrapper.INSTANCE.toDto(pageList));
} }
public AjaxResult user() {
List<User> userList = userService.list(new QueryWrapper<User>()
.lambda()
.in(User::getUserName, "沈佳峰", "屠勇", "王焕", "朱宗华", "王孟卓")
);
return AjaxResult.ok().data(userList);
}
} }

View File

@ -13,6 +13,7 @@ import com.ydool.system.request.ImageRequest;
import com.ydool.system.request.UserRequest; import com.ydool.system.request.UserRequest;
import com.ydool.system.request.UserRolesRequest; import com.ydool.system.request.UserRolesRequest;
import com.ydool.system.service.IUserService; import com.ydool.system.service.IUserService;
import com.ydool.system.vo.UserVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -203,4 +204,10 @@ public class UserController extends BaseController {
public AjaxResult editImage(@RequestBody @Validated ImageRequest imageRequest) { public AjaxResult editImage(@RequestBody @Validated ImageRequest imageRequest) {
return userService.editImage(imageRequest); return userService.editImage(imageRequest);
} }
@PostMapping(value = "/user")
@ApiOperation(value = "关联人员")
public AjaxResult user(@RequestBody @Validated UserVo userVo) {
return userService.user(userVo);
}
} }

View File

@ -8,6 +8,7 @@ import com.ydool.system.request.IdsRequest;
import com.ydool.system.request.ImageRequest; import com.ydool.system.request.ImageRequest;
import com.ydool.system.request.UserRequest; import com.ydool.system.request.UserRequest;
import com.ydool.system.request.UserRolesRequest; import com.ydool.system.request.UserRolesRequest;
import com.ydool.system.vo.UserVo;
import java.util.List; import java.util.List;
@ -134,5 +135,7 @@ public interface IUserService {
* @return * @return
*/ */
AjaxResult editImage(ImageRequest imageRequest); AjaxResult editImage(ImageRequest imageRequest);
AjaxResult user(UserVo userVo);
} }

View File

@ -28,6 +28,7 @@ import com.ydool.system.request.ImageRequest;
import com.ydool.system.request.UserRequest; import com.ydool.system.request.UserRequest;
import com.ydool.system.request.UserRolesRequest; import com.ydool.system.request.UserRolesRequest;
import com.ydool.system.service.IUserService; import com.ydool.system.service.IUserService;
import com.ydool.system.vo.UserVo;
import com.ydool.system.wrapper.UserWrapper; import com.ydool.system.wrapper.UserWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -429,6 +430,31 @@ public class UserServiceImpl extends BaseService<UserMapper, User> implements IU
return flag ? AjaxResult.ok().msg("更换头像成功") : AjaxResult.fail("更换头像失败"); return flag ? AjaxResult.ok().msg("更换头像成功") : AjaxResult.fail("更换头像失败");
} }
@Override
public AjaxResult user(UserVo userVo) {
String value = userVo.getValue();
String job = userVo.getJob();
MPJQueryWrapper<User> qw = new MPJQueryWrapper<User>();
qw.selectAll(User.class).leftJoin("t_sys_dept dept on dept.id = t.dept");
if (StrUtil.isNotBlank(value)) {
qw.and(query ->
query.like("AES_DECRYPT(from_base64 (t.phone),'" + CodecUtils.KEY + "')", value).lambda()
.or().like(User::getLoginName, value)
.or().like(User::getRemarks, value)
.or().like(User::getUserName, value));
}
qw.lambda()
.in(CollUtil.isNotEmpty(userVo.getDeptIds()), User::getDept, userVo.getDeptIds())
.eq(StrUtil.isNotBlank(job), User::getJob, job);
qw.orderByAsc("dept.sort_no");
Page<User> pageList = page(new Page<>(userVo.getCurrent(), userVo.getSize()), qw);
return AjaxResult.ok().data(UserWrapper.INSTANCE.toDto(pageList));
}
/** /**
* 校验用户 * 校验用户

View File

@ -0,0 +1,21 @@
package com.ydool.system.vo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import java.util.List;
@Data
public class UserVo {
@ApiModelProperty(value = "当前页")
private Integer current;
@ApiModelProperty(value = "每页条数")
private Integer size;
@ApiModelProperty(value = "部门")
private List<String> deptIds;
@ApiModelProperty(value = "岗位")
private String job;
@ApiModelProperty(value = "搜索框中的内容(只支持字符串类型)")
private String value;
}

View File

@ -16,7 +16,7 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://192.168.2.57:3306/lc_oa?useSSL=false&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true url: jdbc:mysql://localhost:3306/lc_oa?useSSL=false&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root username: root
password: Wang09211108 password: Wang09211108
druid: druid: