8/15 搜索用户加入仓库字段

workplace
wangwei 11 months ago
parent dcd227d367
commit 67726020ec

@ -53,6 +53,9 @@ public class AuthAdmin {
@TableField(exist = false)
private String deptName;
@TableField(exist = false)
private String invName;
@TableField(exist = false)
private List<SysRole> roles;

@ -31,4 +31,5 @@ public class FilterAuthUserRequest extends ListPageRequest {
private String deptCode;
private String invCode; //仓库号
private String key;
private String userKey;
}

@ -3,6 +3,8 @@ package com.glxp.api.req.basic;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.List;
/**
* @author : zhangsan
* @date : 2024/8/14 18:55
@ -13,7 +15,8 @@ import lombok.Data;
public class BasicCollectUserRequest extends ListPageRequest {
private String userId;
private String workplaceId;
private List<String> workplaceId;
private String workplaceCode;
private String userKey;
private String workKey;

@ -39,6 +39,7 @@ public class AuthAdminResponse {
private List<Long> roles;
private String dept;
private String deptName;
private String invName;
private List<Long> depts;

@ -3,6 +3,7 @@ package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.glxp.api.req.basic.BasicCollectUserRequest;
import com.glxp.api.res.basic.UserWorkResponse;
import org.aspectj.weaver.ast.Var;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.basic.BasicCollectUserMapper;
@ -24,21 +25,27 @@ public class BasicCollectUserService extends ServiceImpl<BasicCollectUserMapper,
}
public Boolean bindWorkplace(BasicCollectUserRequest request) {
BasicCollectUserEntity basicCollectUserEntity = basicCollectUserMapper.selectOne(new LambdaQueryWrapper<BasicCollectUserEntity>()
.eq(BasicCollectUserEntity::getUserId, request.getUserId())
.eq(BasicCollectUserEntity::getWorkplaceCode,request.getWorkplaceId()));
if (basicCollectUserEntity != null){
//该用户已经绑定改工位
return false;
List<String> workplaceIds = request.getWorkplaceId();
for (String workplaceId : workplaceIds) {
BasicCollectUserEntity basicCollectUserEntity = basicCollectUserMapper.selectOne(new LambdaQueryWrapper<BasicCollectUserEntity>()
.eq(BasicCollectUserEntity::getUserId, request.getUserId())
.eq(BasicCollectUserEntity::getWorkplaceCode,workplaceId));
if (basicCollectUserEntity != null){
//该用户已经绑定改工位
return false;
}
}
BasicCollectUserEntity entity = new BasicCollectUserEntity();
entity.setUserId(Long.valueOf(request.getUserId()));
entity.setWorkplaceCode(Long.valueOf(request.getWorkplaceId()));
entity.setCreateTime(new Date());
entity.setUpdateTime(new Date());
int insert = basicCollectUserMapper.insert(entity);
if (insert == 0){
return false;
for (String workplaceId : workplaceIds) {
BasicCollectUserEntity entity = new BasicCollectUserEntity();
entity.setUserId(Long.valueOf(request.getUserId()));
entity.setWorkplaceCode(Long.valueOf(workplaceId));
entity.setCreateTime(new Date());
entity.setUpdateTime(new Date());
int insert = basicCollectUserMapper.insert(entity);
if (insert == 0){
return false;
}
}
return true;
}

@ -4,9 +4,10 @@
<mapper namespace="com.glxp.api.dao.auth.AuthAdminDao">
<select id="listAdminPage" parameterType="com.glxp.api.req.auth.FilterAuthUserRequest"
resultType="com.glxp.api.entity.auth.AuthAdmin">
SELECT auth_user.*, auth_dept.name deptName
SELECT auth_user.*, auth_dept.name deptName,aw.name invName
FROM auth_user
left join auth_dept on auth_user.locDeptCode = auth_dept.code
left join auth_warehouse aw on aw.code = auth_user.locInvCode
<where>
<if test="ids != null and ids.size > 0">
AND id IN
@ -23,6 +24,9 @@
<if test="neUserName != null and '' != neUserName">
AND userName != #{neUserName}
</if>
<if test="invCode != null and '' != invCode">
AND locInvCode = #{invCode}
</if>
<if test="deptName != null and '' != deptName">
AND auth_dept.name LIKE CONCAT('%', #{deptName}, '%')
</if>
@ -33,6 +37,11 @@
, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="userKey != null and userKey != ''">
AND (auth_user.userName like concat('%', #{userKey}, '%')
or auth_user.employeeName like concat('%', #{userKey}, '%')
)
</if>
<if test="deptCode != null and deptCode != ''">
AND auth_user.locDeptCode = #{deptCode}
</if>

@ -11,8 +11,8 @@
<if test=" userId != null and userId != ''">
AND bcu.userId = #{userId}
</if>
<if test=" workplaceId != null and workplaceId != ''">
AND bcu.workplaceCode = #{workplaceId}
<if test=" workplaceCode != null and workplaceCode != ''">
AND bcu.workplaceCode = #{workplaceCode}
</if>
<if test="userKey != null and userKey != ''">
AND (au.employeeName like concat('%', #{userKey}, '%')

Loading…
Cancel
Save