不同企业下的部门名称不能重复bug修改
This commit is contained in:
parent
384c080c28
commit
1a377cda8d
@ -175,6 +175,7 @@ public class AsyncProjectWork {
|
||||
teamName = teamName + "-" + enterpriseName;
|
||||
QueryWrapper<DepartmentInfo> departmentInfoQueryWrapper = new QueryWrapper<>();
|
||||
departmentInfoQueryWrapper.lambda().eq(DepartmentInfo::getProjectSn, workerInfo.getProjectSn())
|
||||
.eq(DepartmentInfo::getEnterpriseId, workerInfo.getEnterpriseId())
|
||||
.eq(DepartmentInfo::getDepartmentName, teamName);
|
||||
DepartmentInfo oldDepartmentInfo = departmentInfoMapper.selectOne(departmentInfoQueryWrapper);
|
||||
if (oldDepartmentInfo != null) {
|
||||
|
||||
@ -183,6 +183,7 @@ public class ProjectWorkerApiController {
|
||||
if (workerVo.getPersonType() == 2) {
|
||||
QueryWrapper<DepartmentInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(DepartmentInfo::getDepartmentName, workerVo.getGroupName())
|
||||
.eq(DepartmentInfo::getEnterpriseId, enterpriseInfo.getId())
|
||||
.eq(DepartmentInfo::getProjectSn, workerVo.getProjectCode());
|
||||
DepartmentInfo departmentInfo = departmentInfoService.getOne(queryWrapper);
|
||||
if (departmentInfo == null) {
|
||||
|
||||
@ -3,7 +3,6 @@ package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.async.AsyncHikvision;
|
||||
import com.zhgd.xmgl.async.AsyncJiLianDa;
|
||||
import com.zhgd.xmgl.async.AsyncWorker;
|
||||
@ -87,6 +86,7 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
|
||||
public DepartmentInfo saveDepartmentInfo(DepartmentInfo departmentInfo) {
|
||||
QueryWrapper<DepartmentInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(DepartmentInfo::getProjectSn, departmentInfo.getProjectSn())
|
||||
.eq(DepartmentInfo::getEnterpriseId, departmentInfo.getEnterpriseId())
|
||||
.eq(DepartmentInfo::getDepartmentName, departmentInfo.getDepartmentName());
|
||||
int count = departmentInfoMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
@ -107,6 +107,7 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
|
||||
QueryWrapper<DepartmentInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(DepartmentInfo::getProjectSn, departmentInfo.getProjectSn())
|
||||
.eq(DepartmentInfo::getDepartmentName, departmentInfo.getDepartmentName())
|
||||
.eq(DepartmentInfo::getEnterpriseId, departmentInfo.getEnterpriseId())
|
||||
.ne(DepartmentInfo::getId, departmentInfo.getId());
|
||||
int count = departmentInfoMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
|
||||
@ -1408,6 +1408,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
if (personType == 2) {
|
||||
QueryWrapper<DepartmentInfo> departmentInfoQueryWrapper = new QueryWrapper<>();
|
||||
departmentInfoQueryWrapper.lambda().eq(DepartmentInfo::getProjectSn, workerInfo.getProjectSn())
|
||||
.eq(DepartmentInfo::getEnterpriseId, workerInfo.getEnterpriseId())
|
||||
.eq(DepartmentInfo::getDepartmentName, MapUtils.getString(info, "teamName"));
|
||||
DepartmentInfo oldDepartmentInfo = departmentInfoMapper.selectOne(departmentInfoQueryWrapper);
|
||||
if (oldDepartmentInfo != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user