租户表修改、部门添加租户id

master 05
hshansha 7 months ago
parent 0e786132f7
commit 4a40fa470b

@ -30,6 +30,11 @@ public class SysDept extends TreeEntity<SysDept> {
@TableId(value = "dept_id")
private Long deptId;
/**
* ID
*/
private Long tenantId;
/**
*
*/

@ -63,6 +63,7 @@ public class MybatisPlusConfig {
//系统表
"sys_user",
"sys_role",
"sys_dept",
//业务表
"pay_attendance",
"pay_baohuo_employee",

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import com.ruoyi.common.exception.ServiceException;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
@ -79,6 +80,18 @@ public class PayEmployeeInfoController extends BaseController {
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody PayEmployeeInfoBo bo) {
PayEmployeeInfoBo em = new PayEmployeeInfoBo();
em.setPhone(bo.getPhone());
List<PayEmployeeInfoVo> payEmployeeInfoVos = iPayEmployeeInfoService.queryList(em);
if (payEmployeeInfoVos!=null&&payEmployeeInfoVos.size()>0) { // 表示重手机号
throw new ServiceException("该手机号已注册");
}
em.setPhone(null);
em.setName(bo.getName());
List<PayEmployeeInfoVo> payEmployeeInfoVos1 = iPayEmployeeInfoService.queryList(em);
if (payEmployeeInfoVos1!=null&&payEmployeeInfoVos1.size()>0) { // 表示重名
throw new ServiceException("系统中存在同名员工");
}
return toAjax(iPayEmployeeInfoService.insertByBo(bo));
}

@ -56,6 +56,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
lqw.eq(SysDept::getDelFlag, "0")
.eq(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId())
.eq(dept.getTenantId() != null, SysDept::getTenantId, dept.getTenantId())
.eq(ObjectUtil.isNotNull(dept.getParentId()), SysDept::getParentId, dept.getParentId())
.like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName())
.eq(StringUtils.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus())

@ -6,6 +6,7 @@
<resultMap type="SysDept" id="SysDeptResult">
<id property="deptId" column="dept_id"/>
<result property="tenantId" column="tenant_id"/>
<result property="parentId" column="parent_id"/>
<result property="ancestors" column="ancestors"/>
<result property="deptName" column="dept_name"/>

Loading…
Cancel
Save