bug修改
This commit is contained in:
@ -364,10 +364,11 @@ public class SubConstructionUserController extends BaseController {
|
|||||||
if (user.getEntryDate() != null) {
|
if (user.getEntryDate() != null) {
|
||||||
vo.setEntryDate(DateUtils.formatDateTime(user.getEntryDate()));
|
vo.setEntryDate(DateUtils.formatDateTime(user.getEntryDate()));
|
||||||
}
|
}
|
||||||
|
//0男 1女 2未知
|
||||||
String sex = vo.getSex();
|
String sex = vo.getSex();
|
||||||
if (sex != null && sex.equals("1")) {
|
if (sex != null && sex.equals("0")) {
|
||||||
vo.setSex("男");
|
vo.setSex("男");
|
||||||
} else if (sex != null && sex.equals("2")) {
|
} else if (sex != null && sex.equals("1")) {
|
||||||
vo.setSex("女");
|
vo.setSex("女");
|
||||||
} else {
|
} else {
|
||||||
vo.setSex("未知");
|
vo.setSex("未知");
|
||||||
|
|||||||
@ -129,6 +129,7 @@ public class DesExtractController extends BaseController {
|
|||||||
@SaCheckPermission("design:extract:userMajor")
|
@SaCheckPermission("design:extract:userMajor")
|
||||||
@GetMapping("/userMajor")
|
@GetMapping("/userMajor")
|
||||||
public R<List<DesUserVo>> selectUserMajor(DesUserBo bo) {
|
public R<List<DesUserVo>> selectUserMajor(DesUserBo bo) {
|
||||||
|
bo.setUserType("1");
|
||||||
return R.ok( deUserService.queryList(bo));
|
return R.ok( deUserService.queryList(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -369,13 +369,14 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
|
|||||||
List<BusBillofquantities> dbList = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
List<BusBillofquantities> dbList = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
||||||
.eq(BusBillofquantities::getVersions, versions)
|
.eq(BusBillofquantities::getVersions, versions)
|
||||||
.eq(BusBillofquantities::getProjectId, projectId)
|
.eq(BusBillofquantities::getProjectId, projectId)
|
||||||
|
.orderByAsc(BusBillofquantities::getId)
|
||||||
);
|
);
|
||||||
if (CollectionUtil.isEmpty(dbList)) {
|
if (CollectionUtil.isEmpty(dbList)) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 转换为导出实体并按sheet分组
|
// 2. 转换为导出实体并按sheet分组
|
||||||
Map<String, List<BillOfQuantitiesExport>> sheetMap = new HashMap<>();
|
Map<String, List<BillOfQuantitiesExport>> sheetMap = new LinkedHashMap<>();
|
||||||
for (BusBillofquantities dbItem : dbList) {
|
for (BusBillofquantities dbItem : dbList) {
|
||||||
BillOfQuantitiesExport exportItem = new BillOfQuantitiesExport();
|
BillOfQuantitiesExport exportItem = new BillOfQuantitiesExport();
|
||||||
BeanUtil.copyProperties(dbItem, exportItem);
|
BeanUtil.copyProperties(dbItem, exportItem);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ package org.dromara.job.attendance;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
||||||
|
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;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -120,11 +121,23 @@ public class AttendanceJob {
|
|||||||
// //查询项目下的关联人员
|
// //查询项目下的关联人员
|
||||||
// List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
// List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
||||||
// .eq(BusUserProjectRelevancy::getProjectId, rule.getProjectId()));
|
// .eq(BusUserProjectRelevancy::getProjectId, rule.getProjectId()));
|
||||||
List<SubConstructionUser> constructionUsers = constructionUserService.list(Wrappers.<SubConstructionUser>lambdaQuery()
|
LambdaQueryWrapper<SubConstructionUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(SubConstructionUser::getProjectId, rule.getProjectId())
|
|
||||||
.isNotNull(SubConstructionUser::getTeamId)
|
// 拼接条件:(role = 1 AND teamId IS NOT NULL) OR (role IN (2))
|
||||||
.eq(SubConstructionUser::getUserRole, "0") //0-施工人员 1-管理人员 2-分包管理人员
|
queryWrapper.eq(SubConstructionUser::getProjectId, rule.getProjectId()) // 全局条件:projectId必选
|
||||||
);
|
// 外层nested:包裹整个OR条件块
|
||||||
|
.nested(w ->
|
||||||
|
// 内层nested:强制 (user_role=0 AND team_id IS NOT NULL) 作为一个整体
|
||||||
|
w.nested(inner -> inner
|
||||||
|
.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId)
|
||||||
|
)
|
||||||
|
.or() // 连接两个子条件
|
||||||
|
.in(SubConstructionUser::getUserRole, Arrays.asList("1", "2"))
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
List<SubConstructionUser> constructionUsers = constructionUserService.list(queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
//查询当天已打上班卡人员
|
//查询当天已打上班卡人员
|
||||||
@ -235,11 +248,23 @@ public class AttendanceJob {
|
|||||||
//查询项目下的关联人员
|
//查询项目下的关联人员
|
||||||
// List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
// List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
||||||
// .eq(BusUserProjectRelevancy::getProjectId, rule.getProjectId()));
|
// .eq(BusUserProjectRelevancy::getProjectId, rule.getProjectId()));
|
||||||
List<SubConstructionUser> constructionUsers = constructionUserService.list(Wrappers.<SubConstructionUser>lambdaQuery()
|
LambdaQueryWrapper<SubConstructionUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(SubConstructionUser::getProjectId, rule.getProjectId())
|
|
||||||
.isNotNull(SubConstructionUser::getTeamId)
|
// 拼接条件:(role = 1 AND teamId IS NOT NULL) OR (role IN (2))
|
||||||
.eq(SubConstructionUser::getUserRole, "0") //0-施工人员 1-管理人员 2-分包管理人员
|
queryWrapper.eq(SubConstructionUser::getProjectId, rule.getProjectId()) // 全局条件:projectId必选
|
||||||
);
|
// 外层nested:包裹整个OR条件块
|
||||||
|
.nested(w ->
|
||||||
|
// 内层nested:强制 (user_role=0 AND team_id IS NOT NULL) 作为一个整体
|
||||||
|
w.nested(inner -> inner
|
||||||
|
.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId)
|
||||||
|
)
|
||||||
|
.or() // 连接两个子条件
|
||||||
|
.in(SubConstructionUser::getUserRole, Arrays.asList("1", "2"))
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
List<SubConstructionUser> constructionUsers = constructionUserService.list(queryWrapper);
|
||||||
//查询当天打卡人员
|
//查询当天打卡人员
|
||||||
List<BusAttendance> allAttendanceList = attendanceService.list(Wrappers.lambdaQuery(BusAttendance.class)
|
List<BusAttendance> allAttendanceList = attendanceService.list(Wrappers.lambdaQuery(BusAttendance.class)
|
||||||
.eq(BusAttendance::getClockDate, date)
|
.eq(BusAttendance::getClockDate, date)
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.contractor.domain.SubContractor;
|
||||||
import org.dromara.contractor.service.ISubContractorService;
|
import org.dromara.contractor.service.ISubContractorService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.out.domain.bo.OutSettlementValueSubcontractBo;
|
import org.dromara.out.domain.bo.OutSettlementValueSubcontractBo;
|
||||||
@ -59,7 +60,11 @@ public class OutSettlementValueSubcontractServiceImpl extends ServiceImpl<OutSet
|
|||||||
LambdaQueryWrapper<OutSettlementValueSubcontract> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<OutSettlementValueSubcontract> lqw = buildQueryWrapper(bo);
|
||||||
Page<OutSettlementValueSubcontractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<OutSettlementValueSubcontractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
result.getRecords().forEach(e -> {
|
result.getRecords().forEach(e -> {
|
||||||
e.setContractorName(contractorService.queryById(e.getContractorId()).getName());
|
SubContractor contractor = contractorService.getById(e.getContractorId());
|
||||||
|
if(contractor != null) {
|
||||||
|
e.setContractorName(contractor.getName());
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.project.controller;
|
package org.dromara.project.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@ -13,10 +14,12 @@ import org.dromara.common.log.enums.BusinessType;
|
|||||||
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.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
import org.dromara.project.domain.dto.leave.BusLeaveManagerReviewReq;
|
import org.dromara.project.domain.dto.leave.BusLeaveManagerReviewReq;
|
||||||
import org.dromara.project.domain.dto.leave.BusLeaveQueryReq;
|
import org.dromara.project.domain.dto.leave.BusLeaveQueryReq;
|
||||||
import org.dromara.project.domain.vo.leave.BusLeaveVo;
|
import org.dromara.project.domain.vo.leave.BusLeaveVo;
|
||||||
import org.dromara.project.service.IBusLeaveService;
|
import org.dromara.project.service.IBusLeaveService;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -36,6 +39,8 @@ public class BusLeaveController extends BaseController {
|
|||||||
|
|
||||||
private final IBusLeaveService busLeaveService;
|
private final IBusLeaveService busLeaveService;
|
||||||
|
|
||||||
|
private final IBusProjectTeamService projectTeamService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询施工人员请假申请列表
|
* 查询施工人员请假申请列表
|
||||||
*/
|
*/
|
||||||
@ -91,4 +96,17 @@ public class BusLeaveController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(busLeaveService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(busLeaveService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目下所有班组
|
||||||
|
*/
|
||||||
|
@GetMapping("/teamList")
|
||||||
|
public R<List<BusProjectTeam>> add(Long projectId) {
|
||||||
|
List<BusProjectTeam> list = projectTeamService.list(Wrappers.lambdaQuery(BusProjectTeam.class)
|
||||||
|
.select(BusProjectTeam::getId, BusProjectTeam::getTeamName)
|
||||||
|
.eq(BusProjectTeam::getProjectId, projectId)
|
||||||
|
);
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.project.controller;
|
package org.dromara.project.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@ -13,9 +14,12 @@ import org.dromara.common.log.enums.BusinessType;
|
|||||||
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.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
|
import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq;
|
||||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardManagerReviewReq;
|
import org.dromara.project.domain.dto.reissuecard.BusReissueCardManagerReviewReq;
|
||||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
||||||
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.project.service.IBusReissueCardService;
|
import org.dromara.project.service.IBusReissueCardService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -36,6 +40,8 @@ public class BusReissueCardController extends BaseController {
|
|||||||
|
|
||||||
private final IBusReissueCardService busReissueCardService;
|
private final IBusReissueCardService busReissueCardService;
|
||||||
|
|
||||||
|
private final IBusProjectTeamService projectTeamService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询施工人员补卡申请列表
|
* 查询施工人员补卡申请列表
|
||||||
*/
|
*/
|
||||||
@ -91,4 +97,16 @@ public class BusReissueCardController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(busReissueCardService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(busReissueCardService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目下所有班组
|
||||||
|
*/
|
||||||
|
@GetMapping("/teamList")
|
||||||
|
public R<List<BusProjectTeam>> add(Long projectId) {
|
||||||
|
List<BusProjectTeam> list = projectTeamService.list(Wrappers.lambdaQuery(BusProjectTeam.class)
|
||||||
|
.select(BusProjectTeam::getId, BusProjectTeam::getTeamName)
|
||||||
|
.eq(BusProjectTeam::getProjectId, projectId)
|
||||||
|
);
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.dromara.project.mapper;
|
package org.dromara.project.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.project.domain.BusProjectTeam;
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo;
|
import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目班组Mapper接口
|
* 项目班组Mapper接口
|
||||||
*
|
*
|
||||||
@ -12,4 +15,5 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface BusProjectTeamMapper extends BaseMapperPlus<BusProjectTeam, BusProjectTeamVo> {
|
public interface BusProjectTeamMapper extends BaseMapperPlus<BusProjectTeam, BusProjectTeamVo> {
|
||||||
|
|
||||||
|
List<BusProjectTeam> selectByPunchRangeIn(@Param("punchRangeList") List<String> punchRangeList);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
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.project.domain.BusProjectTeam;
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
@ -126,4 +127,6 @@ public interface IBusProjectTeamService extends IService<BusProjectTeam> {
|
|||||||
Boolean deleteUserId(Long id,Long userId);
|
Boolean deleteUserId(Long id,Long userId);
|
||||||
|
|
||||||
List<TeamManageVo> getManager(Long teamId);
|
List<TeamManageVo> getManager(Long teamId);
|
||||||
|
|
||||||
|
List<BusProjectTeam> selectByPunchRangeIn(List<String> punchRangeList);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -353,7 +353,6 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
throw new ServiceException("当前用户没有设置工资,禁止打卡", HttpStatus.ERROR);
|
throw new ServiceException("当前用户没有设置工资,禁止打卡", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断用户是否已经被拉黑
|
// 判断用户是否已经被拉黑
|
||||||
constructionBlacklistService.validUserInBlacklist(constructionUser.getSysUserId(), req.getProjectId());
|
constructionBlacklistService.validUserInBlacklist(constructionUser.getSysUserId(), req.getProjectId());
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.project.service.impl;
|
package org.dromara.project.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -9,6 +11,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.project.domain.bo.BusProjectPunchrangeBo;
|
import org.dromara.project.domain.bo.BusProjectPunchrangeBo;
|
||||||
import org.dromara.project.domain.vo.BusProjectPunchrangeVo;
|
import org.dromara.project.domain.vo.BusProjectPunchrangeVo;
|
||||||
@ -16,9 +21,11 @@ import org.dromara.project.domain.BusProjectPunchrange;
|
|||||||
import org.dromara.project.mapper.BusProjectPunchrangeMapper;
|
import org.dromara.project.mapper.BusProjectPunchrangeMapper;
|
||||||
import org.dromara.project.service.IBusProjectPunchrangeService;
|
import org.dromara.project.service.IBusProjectPunchrangeService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目打卡范围Service业务层处理
|
* 项目打卡范围Service业务层处理
|
||||||
@ -33,6 +40,10 @@ public class BusProjectPunchrangeServiceImpl extends ServiceImpl<BusProjectPunch
|
|||||||
|
|
||||||
private final BusProjectPunchrangeMapper baseMapper;
|
private final BusProjectPunchrangeMapper baseMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
@Lazy
|
||||||
|
private IBusProjectTeamService busProjectTeamService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目打卡范围
|
* 查询项目打卡范围
|
||||||
*
|
*
|
||||||
@ -130,6 +141,13 @@ public class BusProjectPunchrangeServiceImpl extends ServiceImpl<BusProjectPunch
|
|||||||
if(isValid){
|
if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
|
List<String> idList = ids.stream()
|
||||||
|
.map(String::valueOf) // 核心:将 Long 转为 String
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<BusProjectTeam> busProjectTeams = busProjectTeamService.selectByPunchRangeIn(idList);
|
||||||
|
if(!busProjectTeams.isEmpty()){
|
||||||
|
throw new ServiceException("项目打卡范围正在被使用,请先解除关联关系!" );
|
||||||
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -354,8 +354,6 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
|||||||
projectTeamVo.setContractorName(subContractor.getName());
|
projectTeamVo.setContractorName(subContractor.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取班组人数
|
// 获取班组人数
|
||||||
Long peopleNumber = projectTeamMemberService.lambdaQuery()
|
Long peopleNumber = projectTeamMemberService.lambdaQuery()
|
||||||
.eq(BusProjectTeamMember::getTeamId, projectTeam.getId())
|
.eq(BusProjectTeamMember::getTeamId, projectTeam.getId())
|
||||||
@ -475,7 +473,7 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
|||||||
LambdaQueryWrapper<BusProjectTeam> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BusProjectTeam> lqw = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
lqw.apply("FIND_IN_SET({0}, user_id) > 0", userId);
|
lqw.apply("FIND_IN_SET({0}, user_id) > 0", userId);
|
||||||
lqw.eq(BusProjectTeam::getProjectId, projectId);
|
lqw.eq(projectId!=null,BusProjectTeam::getProjectId, projectId);
|
||||||
List<BusProjectTeam> projectTeamList = list(lqw);
|
List<BusProjectTeam> projectTeamList = list(lqw);
|
||||||
if (CollUtil.isNotEmpty(projectTeamList)) {
|
if (CollUtil.isNotEmpty(projectTeamList)) {
|
||||||
return projectTeamList.stream().map(projectTeam -> {
|
return projectTeamList.stream().map(projectTeam -> {
|
||||||
@ -539,4 +537,9 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
|||||||
}
|
}
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BusProjectTeam> selectByPunchRangeIn(List<String> punchRangeList) {
|
||||||
|
return baseMapper.selectByPunchRangeIn(punchRangeList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -213,6 +213,8 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
|
|||||||
if (CollUtil.isNotEmpty(sysUserVos)) {
|
if (CollUtil.isNotEmpty(sysUserVos)) {
|
||||||
List<Long> userIds = sysUserVos.stream().map(SysUserVo::getUserId).toList();
|
List<Long> userIds = sysUserVos.stream().map(SysUserVo::getUserId).toList();
|
||||||
lqw.in(HseSafetyLog::getCreateBy, userIds);
|
lqw.in(HseSafetyLog::getCreateBy, userIds);
|
||||||
|
}else {
|
||||||
|
lqw.eq(HseSafetyLog::getCreateBy, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 模糊查询
|
// 模糊查询
|
||||||
|
|||||||
@ -40,6 +40,8 @@ import org.dromara.design.service.IDesUserService;
|
|||||||
import org.dromara.design.service.IDesVolumeCatalogService;
|
import org.dromara.design.service.IDesVolumeCatalogService;
|
||||||
import org.dromara.design.service.IDesVolumeFileService;
|
import org.dromara.design.service.IDesVolumeFileService;
|
||||||
import org.dromara.project.domain.BusUserProjectRelevancy;
|
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||||
|
import org.dromara.project.domain.vo.projectteam.BusProjectTeamAppVo;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
||||||
import org.dromara.system.domain.*;
|
import org.dromara.system.domain.*;
|
||||||
import org.dromara.system.domain.bo.SysUserBo;
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
@ -108,6 +110,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ISysUserFileService userFileService;
|
private ISysUserFileService userFileService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private IBusProjectTeamService projectTeamService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<SysUserVo> selectPageUserList(SysUserBo user, PageQuery pageQuery) {
|
public TableDataInfo<SysUserVo> selectPageUserList(SysUserBo user, PageQuery pageQuery) {
|
||||||
Page<SysUserVo> page = baseMapper.selectPageUserList(pageQuery.build(), this.buildQueryWrapper(user));
|
Page<SysUserVo> page = baseMapper.selectPageUserList(pageQuery.build(), this.buildQueryWrapper(user));
|
||||||
@ -910,6 +916,14 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
if(appUserType.equals(sysUser.getAppUserType())){
|
if(appUserType.equals(sysUser.getAppUserType())){
|
||||||
throw new ServiceException("当前已是选中用户类型 !");
|
throw new ServiceException("当前已是选中用户类型 !");
|
||||||
}
|
}
|
||||||
|
String oldType = sysUser.getAppUserType();
|
||||||
|
if(AppUserTypeEnum.FB.getType().equals(oldType)){
|
||||||
|
List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(sysUser.getUserId(), null);
|
||||||
|
if (!byUserId.isEmpty()) {
|
||||||
|
throw new ServiceException("请先解除对班组的管理!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Long contractorId = null;
|
Long contractorId = null;
|
||||||
SubConstructionUser constructionUser = constructionUserService.lambdaQuery()
|
SubConstructionUser constructionUser = constructionUserService.lambdaQuery()
|
||||||
.eq(SubConstructionUser::getSysUserId, userId)
|
.eq(SubConstructionUser::getSysUserId, userId)
|
||||||
@ -924,7 +938,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
);
|
);
|
||||||
contractorId = constructionUser.getContractorId();
|
contractorId = constructionUser.getContractorId();
|
||||||
}
|
}
|
||||||
String oldType = sysUser.getAppUserType();
|
|
||||||
|
|
||||||
if (AppUserTypeEnum.SG.getType().equals(oldType)) { //施工人员->管理人员/分包人员
|
if (AppUserTypeEnum.SG.getType().equals(oldType)) { //施工人员->管理人员/分包人员
|
||||||
//清除app所有角色
|
//清除app所有角色
|
||||||
userRoleMapper.deleteAppRoleByUserId(userId);
|
userRoleMapper.deleteAppRoleByUserId(userId);
|
||||||
@ -967,6 +982,11 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
relevancies.add(relevancy);
|
relevancies.add(relevancy);
|
||||||
}
|
}
|
||||||
userProjectRelevancyService.saveBatch(relevancies);
|
userProjectRelevancyService.saveBatch(relevancies);
|
||||||
|
//然后取第一条数据赋值到实名认证表里
|
||||||
|
constructionUserService.lambdaUpdate()
|
||||||
|
.eq(SubConstructionUser::getSysUserId, userId)
|
||||||
|
.set(SubConstructionUser::getProjectId, projectIds.getFirst())
|
||||||
|
.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseMapper.update(null,
|
return baseMapper.update(null,
|
||||||
|
|||||||
@ -4,4 +4,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.project.mapper.BusProjectTeamMapper">
|
<mapper namespace="org.dromara.project.mapper.BusProjectTeamMapper">
|
||||||
|
|
||||||
|
<select id="selectByPunchRangeIn" resultType="org.dromara.project.domain.BusProjectTeam">
|
||||||
|
SELECT *
|
||||||
|
FROM bus_project_team
|
||||||
|
<where>
|
||||||
|
<!-- 遍历参数集合,拼接 JSON_CONTAINS 条件 -->
|
||||||
|
<foreach collection="punchRangeList" item="item" index="index" open="(" close=")" separator="OR">
|
||||||
|
<!-- 关键:item 是传入的参数,用双引号包裹(JSON 字符串格式) -->
|
||||||
|
JSON_CONTAINS(punch_range, CONCAT('"', #{item}, '"')) = 1
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user