bug
This commit is contained in:
@ -341,8 +341,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
BeanUtils.copyProperties(req, constructionUser);
|
BeanUtils.copyProperties(req, constructionUser);
|
||||||
// 数据校验
|
// 数据校验
|
||||||
validEntityBeforeSave(constructionUser, true);
|
validEntityBeforeSave(constructionUser, true);
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(req.getProjectId(), userId);
|
|
||||||
String phone = constructionUser.getPhone();
|
String phone = constructionUser.getPhone();
|
||||||
// SysUserVo userVo = userService.selectUserByPhonenumber(phone);
|
// SysUserVo userVo = userService.selectUserByPhonenumber(phone);
|
||||||
// if (userVo == null) {
|
// if (userVo == null) {
|
||||||
@ -395,9 +394,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
if (oldConstructionUser == null) {
|
if (oldConstructionUser == null) {
|
||||||
throw new ServiceException("修改施工人员失败,数据不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("修改施工人员失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断当前操作用户是否有权限
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(oldConstructionUser.getProjectId(), userId);
|
|
||||||
// 同步更新特种证
|
// 同步更新特种证
|
||||||
if (req.getSpecialWorkPic() != null) {
|
if (req.getSpecialWorkPic() != null) {
|
||||||
boolean save = true;
|
boolean save = true;
|
||||||
@ -438,8 +435,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断当前操作用户是否有权限
|
// 判断当前操作用户是否有权限
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(oldConstructionUser.getProjectId(), userId);
|
|
||||||
SubConstructionUser constructionUser = new SubConstructionUser();
|
SubConstructionUser constructionUser = new SubConstructionUser();
|
||||||
constructionUser.setId(id);
|
constructionUser.setId(id);
|
||||||
// 修改薪水
|
// 修改薪水
|
||||||
@ -464,8 +460,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断当前操作用户是否有权限
|
// 判断当前操作用户是否有权限
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(oldConstructionUser.getProjectId(), userId);
|
|
||||||
if (clock.equals(oldConstructionUser.getClock())) {
|
if (clock.equals(oldConstructionUser.getClock())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -489,9 +484,8 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
if (constructionUser == null) {
|
if (constructionUser == null) {
|
||||||
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("施工人员信息不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断当前操作用户是否有权限
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(List.of(constructionUser.getProjectId(), req.getProjectId()), userId);
|
|
||||||
// 判断用户是否还存在于班组
|
// 判断用户是否还存在于班组
|
||||||
Long count = projectTeamMemberService.lambdaQuery().eq(BusProjectTeamMember::getMemberId, id).count();
|
Long count = projectTeamMemberService.lambdaQuery().eq(BusProjectTeamMember::getMemberId, id).count();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
@ -535,12 +529,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
if (constructionUserList.size() != idList.size()) {
|
if (constructionUserList.size() != idList.size()) {
|
||||||
throw new ServiceException("修改施工人员状态失败,数据缺失", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("修改施工人员状态失败,数据缺失", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
// 判断当前操作用户是否有权限
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<Long> projectIdList = constructionUserList.stream()
|
|
||||||
.map(SubConstructionUser::getProjectId)
|
|
||||||
.distinct().toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 批量修改
|
// 批量修改
|
||||||
List<SubConstructionUser> list = constructionUserList.stream()
|
List<SubConstructionUser> list = constructionUserList.stream()
|
||||||
.filter(user -> !status.equals(user.getStatus()))
|
.filter(user -> !status.equals(user.getStatus()))
|
||||||
@ -581,9 +570,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
if (projectService.getById(projectId) == null) {
|
if (projectService.getById(projectId) == null) {
|
||||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 权限校验
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
// 操作数据库,批量修改
|
// 操作数据库,批量修改
|
||||||
LambdaUpdateWrapper<SubConstructionUser> lambdaUpdate = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
LambdaUpdateWrapper<SubConstructionUser> lambdaUpdate = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
||||||
.eq(SubConstructionUser::getProjectId, projectId)
|
.eq(SubConstructionUser::getProjectId, projectId)
|
||||||
@ -663,14 +650,10 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
// Long userId = LoginHelper.getUserId();
|
||||||
List<SubConstructionUser> constructionUserList = this.listByIds(ids);
|
List<SubConstructionUser> constructionUserList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = constructionUserList.stream().map(SubConstructionUser::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 判断待删除的人员是否存在于班组
|
// 判断待删除的人员是否存在于班组
|
||||||
LambdaQueryWrapper<BusProjectTeamMember> projectTeamMemberLqw = Wrappers.lambdaQuery(BusProjectTeamMember.class)
|
LambdaQueryWrapper<BusProjectTeamMember> projectTeamMemberLqw = Wrappers.lambdaQuery(BusProjectTeamMember.class)
|
||||||
.in(BusProjectTeamMember::getMemberId, ids);
|
.in(BusProjectTeamMember::getMemberId, ids);
|
||||||
|
|||||||
@ -171,11 +171,7 @@ public class SubContractorMaterialRecordServiceImpl extends ServiceImpl<SubContr
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubContractorMaterialRecord> list = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
List<Long> projectIdList = list.stream().map(SubContractorMaterialRecord::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,12 +161,7 @@ public class SubContractorMaterialServiceImpl extends ServiceImpl<SubContractorM
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubContractorMaterial> contractorMaterialList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectIdList = contractorMaterialList.stream().map(SubContractorMaterial::getProjectId).distinct().toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -198,13 +198,9 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubContractor> contractorList = this.listByIds(ids);
|
List<SubContractor> contractorList = this.listByIds(ids);
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
// 做一些业务上的校验,判断是否需要校验
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 仅当前项目下的用户可以删除
|
|
||||||
List<Long> projectIdList = contractorList.stream().map(SubContractor::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 判断当前分包公司下是否还包含施工人员
|
// 判断当前分包公司下是否还包含施工人员
|
||||||
LambdaQueryWrapper<SubConstructionUser> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SubConstructionUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(SubConstructionUser::getContractorId, ids);
|
queryWrapper.in(SubConstructionUser::getContractorId, ids);
|
||||||
|
|||||||
@ -171,11 +171,7 @@ public class SubContractorToolRecordServiceImpl extends ServiceImpl<SubContracto
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubContractorToolRecord> list = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
List<Long> projectIdList = list.stream().map(SubContractorToolRecord::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,12 +161,7 @@ public class SubContractorToolServiceImpl extends ServiceImpl<SubContractorToolM
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubContractorTool> contractorToolList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectIdList = contractorToolList.stream().map(SubContractorTool::getProjectId).distinct().toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,11 +188,8 @@ public class SubSubcontractServiceImpl extends ServiceImpl<SubSubcontractMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<SubSubcontract> list = this.listByIds(ids);
|
List<SubSubcontract> list = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
List<Long> projectIdList = list.stream().map(SubSubcontract::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
// 关联删除文件
|
// 关联删除文件
|
||||||
Set<Long> fileIdList = list.stream().map(SubSubcontract::getContractFileId).collect(Collectors.toSet());
|
Set<Long> fileIdList = list.stream().map(SubSubcontract::getContractFileId).collect(Collectors.toSet());
|
||||||
|
|||||||
@ -326,13 +326,10 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<DesTechnicalStandard> documentList = this.listByIds(ids);
|
List<DesTechnicalStandard> documentList = this.listByIds(ids);
|
||||||
if (CollUtil.isEmpty(documentList)) {
|
if (CollUtil.isEmpty(documentList)) {
|
||||||
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
Set<Long> projectIdList = documentList.stream().map(DesTechnicalStandard::getProjectId).collect(Collectors.toSet());
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
boolean result = this.removeBatchByIds(ids);
|
boolean result = this.removeBatchByIds(ids);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
||||||
|
|||||||
@ -396,12 +396,7 @@ public class FacBoxTransformerServiceImpl extends ServiceImpl<FacBoxTransformerM
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacBoxTransformer> boxTransformerList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = boxTransformerList.stream().map(FacBoxTransformer::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -396,12 +396,7 @@ public class FacInverterServiceImpl extends ServiceImpl<FacInverterMapper, FacIn
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacInverter> inverterList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = inverterList.stream().map(FacInverter::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -395,7 +395,6 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacMatrix> matrixList = this.listByIds(ids);
|
List<FacMatrix> matrixList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
@ -404,7 +403,6 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
|||||||
throw new ServiceException("仅能删除单个项目下的方阵", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("仅能删除单个项目下的方阵", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
Long projectId = projectIds.getFirst();
|
Long projectId = projectIds.getFirst();
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
// 判断方阵下是否存在光伏板信息
|
// 判断方阵下是否存在光伏板信息
|
||||||
Long photovoltaicPanelCount = photovoltaicPanelService.lambdaQuery()
|
Long photovoltaicPanelCount = photovoltaicPanelService.lambdaQuery()
|
||||||
.eq(FacPhotovoltaicPanel::getProjectId, projectId)
|
.eq(FacPhotovoltaicPanel::getProjectId, projectId)
|
||||||
|
|||||||
@ -88,12 +88,7 @@ public class FacPercentageFacilityServiceImpl extends ServiceImpl<FacPercentageF
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacPercentageFacility> percentageFacilityList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = percentageFacilityList.stream().map(FacPercentageFacility::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -265,12 +265,7 @@ public class FacPhotovoltaicPanelColumnServiceImpl extends ServiceImpl<FacPhotov
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacPhotovoltaicPanelColumn> photovoltaicPanelColumnList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = photovoltaicPanelColumnList.stream().map(FacPhotovoltaicPanelColumn::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -265,12 +265,7 @@ public class FacPhotovoltaicPanelPointServiceImpl extends ServiceImpl<FacPhotovo
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacPhotovoltaicPanelPoint> photovoltaicPanelPointList = this.list(this.buildQueryWrapper(null));
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = photovoltaicPanelPointList.stream().map(FacPhotovoltaicPanelPoint::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -636,7 +636,6 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic
|
|||||||
throw new ServiceException("仅能删除单个项目下的光伏板", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("仅能删除单个项目下的光伏板", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
Long projectId = projectIds.getFirst();
|
Long projectId = projectIds.getFirst();
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
// 判断是否存在光伏板点信息
|
// 判断是否存在光伏板点信息
|
||||||
List<String> matrixNames = photovoltaicPanelList.stream().map(FacPhotovoltaicPanel::getName).toList();
|
List<String> matrixNames = photovoltaicPanelList.stream().map(FacPhotovoltaicPanel::getName).toList();
|
||||||
Boolean result = photovoltaicPanelPartsService.validPartsExistByPhotovoltaicPanel(projectId, matrixNames);
|
Boolean result = photovoltaicPanelPartsService.validPartsExistByPhotovoltaicPanel(projectId, matrixNames);
|
||||||
|
|||||||
@ -265,12 +265,7 @@ public class FacPhotovoltaicPanelSupportServiceImpl extends ServiceImpl<FacPhoto
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<FacPhotovoltaicPanelSupport> photovoltaicPanelSupportList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = photovoltaicPanelSupportList.stream().map(FacPhotovoltaicPanelSupport::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,16 +202,9 @@ public class EqpMachineryDetailServiceImpl extends ServiceImpl<EqpMachineryDetai
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<EqpMachineryDetail> machineryDetailList = this.listByIds(ids);
|
List<EqpMachineryDetail> machineryDetailList = this.listByIds(ids);
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
// 做一些业务上的校验,判断是否需要校验
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 获取机械id列表
|
|
||||||
List<Long> machineryIdList = machineryDetailList.stream().map(EqpMachineryDetail::getMachineryId).toList();
|
|
||||||
List<EqpMachinery> machineryList = machineryService.listByIds(machineryIdList);
|
|
||||||
// 获取对应项目id列表
|
|
||||||
List<Long> projectIdList = machineryList.stream().map(EqpMachinery::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
if (machineryDetailList.size() != ids.size()) {
|
if (machineryDetailList.size() != ids.size()) {
|
||||||
throw new ServiceException("删除机械详情失败,数据缺失", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("删除机械详情失败,数据缺失", HttpStatus.BAD_REQUEST);
|
||||||
|
|||||||
@ -190,9 +190,6 @@ public class EqpMachineryServiceImpl extends ServiceImpl<EqpMachineryMapper, Eqp
|
|||||||
if (StringUtils.isNotBlank(principalPhone) && !PhoneUtil.isPhone(principalPhone)) {
|
if (StringUtils.isNotBlank(principalPhone) && !PhoneUtil.isPhone(principalPhone)) {
|
||||||
throw new ServiceException("负责人手机号格式不正确", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("负责人手机号格式不正确", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
// 判断用户是否对项目下的内容有操作权限
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -205,14 +202,9 @@ public class EqpMachineryServiceImpl extends ServiceImpl<EqpMachineryMapper, Eqp
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<EqpMachinery> machineryList = this.listByIds(ids);
|
List<EqpMachinery> machineryList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
// 做一些业务上的校验,判断是否需要校验
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = machineryList.stream().map(EqpMachinery::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 判断是否还存在机械详情信息
|
// 判断是否还存在机械详情信息
|
||||||
QueryWrapper<EqpMachineryDetail> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<EqpMachineryDetail> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("machinery_id", ids);
|
queryWrapper.in("machinery_id", ids);
|
||||||
|
|||||||
@ -185,15 +185,8 @@ public class MatCompanyServiceImpl extends ServiceImpl<MatCompanyMapper, MatComp
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
// 获取当前登录用户
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<MatCompany> companyList = this.listByIds(ids);
|
List<MatCompany> companyList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = companyList.stream().map(MatCompany::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 判断公司中是否还存在材料信息
|
// 判断公司中是否还存在材料信息
|
||||||
QueryWrapper<MatMaterials> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<MatMaterials> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("company_id", ids);
|
queryWrapper.in("company_id", ids);
|
||||||
|
|||||||
@ -283,15 +283,8 @@ public class MatMaterialsInventoryServiceImpl extends ServiceImpl<MatMaterialsIn
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
// 获取当前登录用户
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<MatMaterialsInventory> materialsInventoryList = this.listByIds(ids);
|
List<MatMaterialsInventory> materialsInventoryList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = materialsInventoryList.stream().map(MatMaterialsInventory::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
// 判断对应数据是否都存在
|
// 判断对应数据是否都存在
|
||||||
if (materialsInventoryList.size() != ids.size()) {
|
if (materialsInventoryList.size() != ids.size()) {
|
||||||
|
|||||||
@ -256,14 +256,8 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<MatMaterials> materialsList = this.listByIds(ids);
|
List<MatMaterials> materialsList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = materialsList.stream().map(MatMaterials::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
// 判断公司中是否还存在材料信息
|
// 判断公司中是否还存在材料信息
|
||||||
QueryWrapper<MatMaterialsInventory> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<MatMaterialsInventory> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("materials", ids);
|
queryWrapper.in("materials", ids);
|
||||||
|
|||||||
@ -200,7 +200,6 @@ public class OthDevicePresetServiceImpl extends ServiceImpl<OthDevicePresetMappe
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteById(Long id) {
|
public Boolean deleteById(Long id) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
OthDevicePreset devicePreset = this.getById(id);
|
OthDevicePreset devicePreset = this.getById(id);
|
||||||
String deviceSerial = devicePreset.getDeviceSerial();
|
String deviceSerial = devicePreset.getDeviceSerial();
|
||||||
OthYs7Device device = othYs7DeviceService.lambdaQuery()
|
OthYs7Device device = othYs7DeviceService.lambdaQuery()
|
||||||
@ -209,10 +208,6 @@ public class OthDevicePresetServiceImpl extends ServiceImpl<OthDevicePresetMappe
|
|||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ServiceException("设备不存在", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("设备不存在", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
Long projectId = device.getProjectId();
|
|
||||||
if (projectId != 0) {
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
|
||||||
Boolean result = ys7Manager.deleteDevicePreset(
|
Boolean result = ys7Manager.deleteDevicePreset(
|
||||||
deviceSerial,
|
deviceSerial,
|
||||||
devicePreset.getChannelNo(),
|
devicePreset.getChannelNo(),
|
||||||
|
|||||||
@ -173,9 +173,6 @@ public class OthYs7DeviceServiceImpl extends ServiceImpl<OthYs7DeviceMapper, Oth
|
|||||||
if (project == null) {
|
if (project == null) {
|
||||||
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 权限校验
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
// 更新
|
// 更新
|
||||||
boolean update = this.lambdaUpdate()
|
boolean update = this.lambdaUpdate()
|
||||||
.in(OthYs7Device::getId, ids)
|
.in(OthYs7Device::getId, ids)
|
||||||
@ -232,18 +229,7 @@ public class OthYs7DeviceServiceImpl extends ServiceImpl<OthYs7DeviceMapper, Oth
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<OthYs7Device> deviceList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectIds = deviceList.stream()
|
|
||||||
.map(OthYs7Device::getProjectId)
|
|
||||||
.filter(id -> id != 0)
|
|
||||||
.distinct()
|
|
||||||
.toList();
|
|
||||||
if (CollUtil.isNotEmpty(projectIds)) {
|
|
||||||
projectService.validAuth(projectIds, userId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -184,7 +184,10 @@ public class BusAttendanceAppController extends BaseController {
|
|||||||
|
|
||||||
DaysCountVo daysCountVo = new DaysCountVo();
|
DaysCountVo daysCountVo = new DaysCountVo();
|
||||||
|
|
||||||
SubConstructionUser bySysUserId = constructionUserService.getBySysUserId(userId);
|
SubConstructionUser bySysUserId = constructionUserService.lambdaQuery()
|
||||||
|
.eq(SubConstructionUser::getSysUserId, userId)
|
||||||
|
.one();
|
||||||
|
|
||||||
if(bySysUserId == null || bySysUserId.getFirstDate() == null){
|
if(bySysUserId == null || bySysUserId.getFirstDate() == null){
|
||||||
daysCountVo.setEntryDays(0);
|
daysCountVo.setEntryDays(0);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -158,7 +158,7 @@ public interface IBusProjectService extends IService<BusProject> {
|
|||||||
* @param projectId 项目id
|
* @param projectId 项目id
|
||||||
* @param userId 需要鉴权的用户id
|
* @param userId 需要鉴权的用户id
|
||||||
*/
|
*/
|
||||||
void validAuth(Long projectId, Long userId);
|
// void validAuth(Long projectId, Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户是否拥有操作项目的权限
|
* 校验用户是否拥有操作项目的权限
|
||||||
@ -166,7 +166,7 @@ public interface IBusProjectService extends IService<BusProject> {
|
|||||||
* @param projectIdList 项目id列表
|
* @param projectIdList 项目id列表
|
||||||
* @param userId 需要鉴权的用户id
|
* @param userId 需要鉴权的用户id
|
||||||
*/
|
*/
|
||||||
void validAuth(Collection<Long> projectIdList, Long userId);
|
// void validAuth(Collection<Long> projectIdList, Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取天气信息
|
* 获取天气信息
|
||||||
|
|||||||
@ -341,11 +341,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
//更新打卡时间
|
//更新打卡时间
|
||||||
busAttendance.setClockTime(now);
|
busAttendance.setClockTime(now);
|
||||||
// 判断是否为早退
|
// 判断是否为早退
|
||||||
if (isLeaveEarly(now, busAttendanceRuleVo)) {
|
if (isLeaveEarly(now, busAttendanceRuleVo,localDate)) {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVEEARLY.getValue());
|
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVEEARLY.getValue());
|
||||||
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
||||||
|
busAttendance.setMinuteCount(0);
|
||||||
}
|
}
|
||||||
updateById(busAttendance);
|
updateById(busAttendance);
|
||||||
}else {
|
}else {
|
||||||
@ -354,7 +355,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockType(BusAttendanceCommuterEnum.CLOCKOUT.getValue());
|
attendance.setClockType(BusAttendanceCommuterEnum.CLOCKOUT.getValue());
|
||||||
attendance.setRuleTime(busAttendanceRuleVo.getClockOutTime());
|
attendance.setRuleTime(busAttendanceRuleVo.getClockOutTime());
|
||||||
// 判断是否为早退
|
// 判断是否为早退
|
||||||
if (isLeaveEarly(now, busAttendanceRuleVo)) {
|
if (isLeaveEarly(now, busAttendanceRuleVo,localDate)) {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVEEARLY.getValue());
|
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVEEARLY.getValue());
|
||||||
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
@ -736,19 +737,21 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
/**
|
/**
|
||||||
* 判断是否早退
|
* 判断是否早退
|
||||||
*/
|
*/
|
||||||
private Boolean isLeaveEarly(LocalDateTime checkTime, BusAttendanceRuleVo vo) {
|
private Boolean isLeaveEarly(LocalDateTime checkTime, BusAttendanceRuleVo vo,LocalDate date) {
|
||||||
long clockOutSeconds = vo.getClockOutTime().toSecondOfDay();
|
LocalTime clockOutTime = vo.getClockOutTime();
|
||||||
long clockOutResultSeconds = vo.getClockOutResultTime().toSecondOfDay();
|
LocalTime clockInTime = vo.getClockInTime();
|
||||||
|
|
||||||
if (vo.getClockOutResultTime().isBefore(vo.getClockOutTime())) {
|
LocalDateTime clockOutDateTime;
|
||||||
clockOutResultSeconds += 24 * 60 * 60; // 加24小时的秒数
|
// 构建下班时间和下班最晚打卡时间
|
||||||
|
if(clockOutTime.isBefore(clockInTime)){
|
||||||
|
clockOutDateTime = LocalDateTime.of(date.plusDays(1), clockOutTime);
|
||||||
|
} else {
|
||||||
|
clockOutDateTime = LocalDateTime.of(date, clockOutTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果打卡时间早于下班时间,则为早退
|
||||||
long localTime = checkTime.toLocalTime().toSecondOfDay();
|
// 如果打卡时间晚于下班最晚打卡时间,则为早退
|
||||||
|
return checkTime.isBefore(clockOutDateTime);
|
||||||
return !(localTime > clockOutSeconds && localTime < clockOutResultSeconds);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -820,9 +823,11 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
SysUserVo sysUserVo = userService.selectUserById(constructionUser.getSysUserId());
|
SysUserVo sysUserVo = userService.selectUserById(constructionUser.getSysUserId());
|
||||||
attendanceUserVo.setUserId(constructionUser.getSysUserId());
|
attendanceUserVo.setUserId(constructionUser.getSysUserId());
|
||||||
attendanceUserVo.setNickName(constructionUser.getUserName());
|
attendanceUserVo.setNickName(constructionUser.getUserName());
|
||||||
if (sysUserVo.getAvatar() != null) {
|
if(sysUserVo != null){
|
||||||
SysOssVo byId = ossService.getById(sysUserVo.getAvatar());
|
if (sysUserVo.getAvatar() != null) {
|
||||||
attendanceUserVo.setAvatar(byId == null ? null : byId.getUrl());
|
SysOssVo byId = ossService.getById(sysUserVo.getAvatar());
|
||||||
|
attendanceUserVo.setAvatar(byId == null ? null : byId.getUrl());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
attendanceUserVo.setTypeOfWork(constructionUser.getTypeOfWork());
|
attendanceUserVo.setTypeOfWork(constructionUser.getTypeOfWork());
|
||||||
if(constructionUser.getTeamId() != null){
|
if(constructionUser.getTeamId() != null){
|
||||||
|
|||||||
@ -206,12 +206,7 @@ public class BusConstructionBlacklistServiceImpl extends ServiceImpl<BusConstruc
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<BusConstructionBlacklist> constructionBlacklistList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = constructionBlacklistList.stream().map(BusConstructionBlacklist::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import org.dromara.common.core.utils.ObjectUtils;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.utils.IdCardEncryptorUtil;
|
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
import org.dromara.project.domain.BusConstructionUserExit;
|
import org.dromara.project.domain.BusConstructionUserExit;
|
||||||
@ -56,9 +55,6 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
|
|||||||
@Resource
|
@Resource
|
||||||
private ISubConstructionUserService constructionUserService;
|
private ISubConstructionUserService constructionUserService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IdCardEncryptorUtil idCardEncryptorUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询施工人员入场退场记录信息
|
* 查询施工人员入场退场记录信息
|
||||||
*
|
*
|
||||||
@ -208,11 +204,7 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
|
|||||||
constructionUserExit.setSalaryVoucherFile(salaryVoucherFile);
|
constructionUserExit.setSalaryVoucherFile(salaryVoucherFile);
|
||||||
constructionUserExit.setSalaryConfirmationFile(salaryConfirmationFile);
|
constructionUserExit.setSalaryConfirmationFile(salaryConfirmationFile);
|
||||||
constructionUserExit.setTeamId(constructionUser.getTeamId());
|
constructionUserExit.setTeamId(constructionUser.getTeamId());
|
||||||
String sfzNumber = constructionUser.getSfzNumber();
|
constructionUserExit.setSfzNumber(constructionUser.getSfzNumber());
|
||||||
if (StringUtils.isNotBlank(sfzNumber)) {
|
|
||||||
sfzNumber = idCardEncryptorUtil.decrypt(sfzNumber);
|
|
||||||
constructionUserExit.setSfzNumber(sfzNumber);
|
|
||||||
}
|
|
||||||
constructionUserExit.setEntryDate(constructionUser.getEntryDate());
|
constructionUserExit.setEntryDate(constructionUser.getEntryDate());
|
||||||
constructionUserExit.setLeaveDate(new Date());
|
constructionUserExit.setLeaveDate(new Date());
|
||||||
constructionUserExit.setRemark(req.getRemark());
|
constructionUserExit.setRemark(req.getRemark());
|
||||||
|
|||||||
@ -165,12 +165,7 @@ public class BusProjectFileServiceImpl extends ServiceImpl<BusProjectFileMapper,
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<BusProjectFile> projectFileList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = projectFileList.stream().map(BusProjectFile::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -192,12 +192,7 @@ public class BusProjectNewsServiceImpl extends ServiceImpl<BusProjectNewsMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<BusProjectNews> projectNewsList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = projectNewsList.stream().map(BusProjectNews::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -765,7 +765,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
* @param projectId 项目对象
|
* @param projectId 项目对象
|
||||||
* @param userId 需要鉴权的用户id
|
* @param userId 需要鉴权的用户id
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void validAuth(Long projectId, Long userId) {
|
public void validAuth(Long projectId, Long userId) {
|
||||||
LambdaQueryWrapper<BusUserProjectRelevancy> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BusUserProjectRelevancy> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(BusUserProjectRelevancy::getProjectId, projectId);
|
lqw.eq(BusUserProjectRelevancy::getProjectId, projectId);
|
||||||
@ -781,7 +781,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
* @param projectIdList 项目id列表
|
* @param projectIdList 项目id列表
|
||||||
* @param userId 需要鉴权的用户id
|
* @param userId 需要鉴权的用户id
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void validAuth(Collection<Long> projectIdList, Long userId) {
|
public void validAuth(Collection<Long> projectIdList, Long userId) {
|
||||||
// 查询关联表,返回和用户关联的项目ID列表
|
// 查询关联表,返回和用户关联的项目ID列表
|
||||||
Set<Long> collect = userProjectRelevancyService.listObjs(
|
Set<Long> collect = userProjectRelevancyService.listObjs(
|
||||||
|
|||||||
@ -279,7 +279,6 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteById(BusProjectTeamMemberExitReq req) {
|
public Boolean deleteById(BusProjectTeamMemberExitReq req) {
|
||||||
// 判断是否有权限操作对应项目下的内容
|
// 判断是否有权限操作对应项目下的内容
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
Long id = req.getId();
|
Long id = req.getId();
|
||||||
String salaryVoucherFile = req.getSalaryVoucherFile();
|
String salaryVoucherFile = req.getSalaryVoucherFile();
|
||||||
String salaryConfirmationFile = req.getSalaryConfirmationFile();
|
String salaryConfirmationFile = req.getSalaryConfirmationFile();
|
||||||
@ -290,7 +289,6 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
if (projectTeamMember == null) {
|
if (projectTeamMember == null) {
|
||||||
throw new ServiceException("对应项目班组下的成员不存在", HttpStatus.ERROR);
|
throw new ServiceException("对应项目班组下的成员不存在", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
projectService.validAuth(projectTeamMember.getProjectId(), userId);
|
|
||||||
boolean result = this.removeById(id);
|
boolean result = this.removeById(id);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("删除项目班组下的成员失败,数据库异常", HttpStatus.ERROR);
|
throw new ServiceException("删除项目班组下的成员失败,数据库异常", HttpStatus.ERROR);
|
||||||
|
|||||||
@ -204,9 +204,6 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
|||||||
if (projectService.getById(projectId) == null) {
|
if (projectService.getById(projectId) == null) {
|
||||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 判断用户是否对项目下的内容有操作权限
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
// 校验范围内打卡是否选择了打卡范围
|
// 校验范围内打卡是否选择了打卡范围
|
||||||
if (StringUtils.isNotBlank(isClockIn) && isClockIn.equals("0")) {
|
if (StringUtils.isNotBlank(isClockIn) && isClockIn.equals("0")) {
|
||||||
String punchRange = entity.getPunchRange();
|
String punchRange = entity.getPunchRange();
|
||||||
@ -226,16 +223,9 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
// 获取当前登录用户
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
// 获取待删除数据详情
|
// 获取待删除数据详情
|
||||||
List<BusProjectTeam> projectTeamList = this.listByIds(ids);
|
List<BusProjectTeam> projectTeamList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = projectTeamList.stream().map(BusProjectTeam::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
// 判断对应数据是否都存在
|
// 判断对应数据是否都存在
|
||||||
if (projectTeamList.size() != ids.size()) {
|
if (projectTeamList.size() != ids.size()) {
|
||||||
|
|||||||
@ -232,16 +232,9 @@ public class BusUserProjectRelevancyServiceImpl extends ServiceImpl<BusUserProje
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
// 获取当前登录用户
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
// 获取待删除数据详情
|
// 获取待删除数据详情
|
||||||
List<BusUserProjectRelevancy> busUserProjectRelevancyList = this.listByIds(ids);
|
List<BusUserProjectRelevancy> busUserProjectRelevancyList = this.listByIds(ids);
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// 做一些业务上的校验,判断是否需要校验
|
|
||||||
// 获取项目id列表
|
|
||||||
List<Long> projectIdList = busUserProjectRelevancyList.stream().map(BusUserProjectRelevancy::getProjectId).toList();
|
|
||||||
// 判断是否有权限操作对应项目下的内容
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
// 判断对应数据是否都存在
|
// 判断对应数据是否都存在
|
||||||
if (busUserProjectRelevancyList.size() != ids.size()) {
|
if (busUserProjectRelevancyList.size() != ids.size()) {
|
||||||
|
|||||||
@ -151,7 +151,6 @@ public class BusWorkWageServiceImpl extends ServiceImpl<BusWorkWageMapper, BusWo
|
|||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(BusWorkWage entity, Boolean create) {
|
private void validEntityBeforeSave(BusWorkWage entity, Boolean create) {
|
||||||
// 做一些数据校验,如唯一约束
|
// 做一些数据校验,如唯一约束
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
Long projectId = entity.getProjectId();
|
Long projectId = entity.getProjectId();
|
||||||
if (create) {
|
if (create) {
|
||||||
if (projectId == null) {
|
if (projectId == null) {
|
||||||
@ -161,7 +160,6 @@ public class BusWorkWageServiceImpl extends ServiceImpl<BusWorkWageMapper, BusWo
|
|||||||
if (projectId != null && projectService.getById(projectId) == null) {
|
if (projectId != null && projectService.getById(projectId) == null) {
|
||||||
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -174,14 +172,7 @@ public class BusWorkWageServiceImpl extends ServiceImpl<BusWorkWageMapper, BusWo
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
// 获取当前登录用户
|
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
// 获取待删除数据详情
|
|
||||||
List<BusWorkWage> workWageList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectIdList = workWageList.stream().map(BusWorkWage::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -318,13 +318,10 @@ public class QltKnowledgeDocumentServiceImpl extends ServiceImpl<QltKnowledgeDoc
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<QltKnowledgeDocument> documentList = this.listByIds(ids);
|
List<QltKnowledgeDocument> documentList = this.listByIds(ids);
|
||||||
if (CollUtil.isEmpty(documentList)) {
|
if (CollUtil.isEmpty(documentList)) {
|
||||||
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
Set<Long> projectIdList = documentList.stream().map(QltKnowledgeDocument::getProjectId).collect(Collectors.toSet());
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
boolean result = this.removeBatchByIds(ids);
|
boolean result = this.removeBatchByIds(ids);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
||||||
|
|||||||
@ -181,12 +181,7 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<QltQualityConstructionLog> qualityConstructionLogList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = qualityConstructionLogList.stream().map(QltQualityConstructionLog::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.quality.service.impl;
|
package org.dromara.quality.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -276,12 +277,7 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<QltQualityInspection> qualityInspectionList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = qualityInspectionList.stream().map(QltQualityInspection::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
@ -347,7 +343,7 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
|||||||
Long projectId = req.getProjectId();
|
Long projectId = req.getProjectId();
|
||||||
String inspectionType = req.getInspectionType();
|
String inspectionType = req.getInspectionType();
|
||||||
String inspectionStatus = req.getInspectionStatus();
|
String inspectionStatus = req.getInspectionStatus();
|
||||||
if(inspectionStatus != null){
|
if(StrUtil.isNotBlank(inspectionStatus) ){
|
||||||
String[] split = inspectionStatus.split(",");
|
String[] split = inspectionStatus.split(",");
|
||||||
lqw.in( QltQualityInspection::getInspectionStatus, Arrays.asList(split));
|
lqw.in( QltQualityInspection::getInspectionStatus, Arrays.asList(split));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -319,13 +319,10 @@ public class HseKnowledgeDocumentServiceImpl extends ServiceImpl<HseKnowledgeDoc
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
public Boolean deleteRecycleBinFileBatchByIds(Collection<Long> ids) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseKnowledgeDocument> documentList = this.listByIds(ids);
|
List<HseKnowledgeDocument> documentList = this.listByIds(ids);
|
||||||
if (CollUtil.isEmpty(documentList)) {
|
if (CollUtil.isEmpty(documentList)) {
|
||||||
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
throw new ServiceException("文件不存在", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
Set<Long> projectIdList = documentList.stream().map(HseKnowledgeDocument::getProjectId).collect(Collectors.toSet());
|
|
||||||
projectService.validAuth(projectIdList, userId);
|
|
||||||
boolean result = this.removeBatchByIds(ids);
|
boolean result = this.removeBatchByIds(ids);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
throw new ServiceException("文件删除失败", HttpStatus.ERROR);
|
||||||
|
|||||||
@ -181,12 +181,7 @@ public class HseQuestionBankServiceImpl extends ServiceImpl<HseQuestionBankMappe
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseQuestionBank> questionBankList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = questionBankList.stream().map(HseQuestionBank::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -350,12 +350,7 @@ public class HseQuestionUserAnswerServiceImpl extends ServiceImpl<HseQuestionUse
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseQuestionUserAnswer> questionUserAnswerList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = questionUserAnswerList.stream().map(HseQuestionUserAnswer::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,12 +150,7 @@ public class HseQuestionsCategoryServiceImpl extends ServiceImpl<HseQuestionsCat
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseQuestionsCategory> questionsCategoryList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = questionsCategoryList.stream().map(HseQuestionsCategory::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,12 +149,7 @@ public class HseQuestionsConfigServiceImpl extends ServiceImpl<HseQuestionsConfi
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseQuestionsConfig> questionsConfigList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = questionsConfigList.stream().map(HseQuestionsConfig::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,10 +159,6 @@ public class HseRecognizeRecordServiceImpl extends ServiceImpl<HseRecognizeRecor
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteById(Long id) {
|
public Boolean deleteById(Long id) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
HseRecognizeRecord recognizeRecord = this.getById(id);
|
|
||||||
Long projectId = recognizeRecord.getProjectId();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
return this.removeById(id);
|
return this.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -132,6 +132,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
|||||||
BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
||||||
.eq(BusProjectTeamMember::getMemberId, userId)
|
.eq(BusProjectTeamMember::getMemberId, userId)
|
||||||
.eq(BusProjectTeamMember::getPostId, "0")
|
.eq(BusProjectTeamMember::getPostId, "0")
|
||||||
|
.last("limit 1")
|
||||||
.one();
|
.one();
|
||||||
if (one != null) {
|
if (one != null) {
|
||||||
lqw.eq(HseSafetyInspection::getCorrectorId, userId);
|
lqw.eq(HseSafetyInspection::getCorrectorId, userId);
|
||||||
|
|||||||
@ -188,7 +188,10 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
|
|||||||
Long createBy = safetyLog.getCreateBy();
|
Long createBy = safetyLog.getCreateBy();
|
||||||
if (createBy != null) {
|
if (createBy != null) {
|
||||||
SysUserVo sysUserVo = userMapper.selectVoById(createBy);
|
SysUserVo sysUserVo = userMapper.selectVoById(createBy);
|
||||||
safetyLogVo.setCreator(IdAndNameVO.build(sysUserVo.getUserId(), sysUserVo.getNickName()));
|
if (sysUserVo != null) {
|
||||||
|
safetyLogVo.setCreator(IdAndNameVO.build(sysUserVo.getUserId(), sysUserVo.getNickName()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return safetyLogVo;
|
return safetyLogVo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,12 +183,7 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseTeamMeeting> teamMeetingList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectId = teamMeetingList.stream().map(HseTeamMeeting::getProjectId).toList();
|
|
||||||
projectService.validAuth(projectId, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -327,12 +327,7 @@ public class HseViolationLevelServiceImpl extends ServiceImpl<HseViolationLevelM
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
Long userId = LoginHelper.getUserId();
|
|
||||||
List<HseViolationLevel> violationLevelList = this.listByIds(ids);
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
List<Long> projectIds = violationLevelList.stream().map(HseViolationLevel::getProjectId).distinct().toList();
|
|
||||||
projectService.validAuth(projectIds, userId);
|
|
||||||
}
|
}
|
||||||
return this.removeBatchByIds(ids);
|
return this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,6 +110,7 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
|||||||
BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
||||||
.eq(BusProjectTeamMember::getMemberId, userId)
|
.eq(BusProjectTeamMember::getMemberId, userId)
|
||||||
.eq(BusProjectTeamMember::getPostId, "0")
|
.eq(BusProjectTeamMember::getPostId, "0")
|
||||||
|
.last("limit 1")
|
||||||
.one();
|
.one();
|
||||||
if (one != null) {
|
if (one != null) {
|
||||||
lqw.eq(HseViolationRecord::getCorrectorId, userId);
|
lqw.eq(HseViolationRecord::getCorrectorId, userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user