修改bug

This commit is contained in:
lcj
2025-11-24 11:37:54 +08:00
parent cdf5f8bf5b
commit 15d86526ac

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.constant.DateConstant;
import org.dromara.common.core.constant.HttpStatus;
import org.dromara.common.core.enums.UserType;
@ -47,7 +48,6 @@ import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.contractor.service.ISubContractorService;
import org.dromara.project.domain.*;
import org.dromara.project.domain.dto.attendance.TodayUserDto;
import org.dromara.project.domain.dto.attendance.TwoWeekDto;
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
import org.dromara.project.domain.enums.BusConstructionUserAttendanceStatusEnum;
@ -87,6 +87,7 @@ import static org.dromara.project.domain.enums.BusAttendanceClockStatusEnum.ATTE
* @author lilemy
* @date 2025-03-07
*/
@Slf4j
@Service
public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionUserMapper, SubConstructionUser>
implements ISubConstructionUserService {
@ -1017,7 +1018,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
));
int fileTypeSize = dictTypeService.selectDictDataByType(SubConstructionUserConstant.USER_FILE_TYPE).size();
// 获取用户上传文件数量信息
List<Long> userIdList = constructionUserList.stream().map(SubConstructionUser::getId).toList();
List<Long> userIdList = constructionUserList.stream().map(SubConstructionUser::getSysUserId).toList();
List<SubConstructionUserFile> fileList = constructionUserFileService.lambdaQuery()
.select(SubConstructionUserFile::getId, SubConstructionUserFile::getUserId)
.in(SubConstructionUserFile::getUserId, userIdList)
@ -1046,12 +1047,12 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
constructionUserVo.setStandardSalary(workWageMap.get(key));
}
// 关联施工人员文件上传状态
long count = fileCountMap.getOrDefault(constructionUser.getId(), 0L);
long count = fileCountMap.getOrDefault(constructionUser.getSysUserId(), 0L);
if (count <= 0) {
constructionUserVo.setFileUploadStatus(SubConstructionUserFileStatusEnum.NOUPLOAD.getValue());
} else if (count < fileTypeSize) {
constructionUserVo.setFileUploadStatus(SubConstructionUserFileStatusEnum.PARTUPLOAD.getValue());
} else if (count == fileTypeSize) {
} else if (count >= fileTypeSize) {
constructionUserVo.setFileUploadStatus(SubConstructionUserFileStatusEnum.UPLOAD.getValue());
}
// 解密身份证号码
@ -1253,7 +1254,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
}
}
}
if(attendanceUserIdList.contains(id)){
if (attendanceUserIdList.contains(id)) {
constructionUserAttendanceTotalResp.setClockToday(true);
}
constructionUserAttendanceTotalResp.setAttendanceDays(attendanceDays);
@ -1456,7 +1457,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
* 人脸识别
*
* @param file 图片文件
* @param userId
* @param userId 用户id
* @return 是否匹配成功
*/
@Override
@ -1464,7 +1465,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
String reqBase64 = this.getPicBase64(file);
HumanFaceReq request = new HumanFaceReq();
request.setImage(reqBase64);
if(userId == null){
if (userId == null) {
userId = LoginHelper.getUserId();
}
SubConstructionUser constructionUser = this.getBySysUserId(userId);
@ -1610,16 +1611,16 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
.eq(StrUtil.isNotBlank(dto.getTypeOfWork()), SubConstructionUser::getTypeOfWork, dto.getTypeOfWork())
.like(StrUtil.isNotBlank(dto.getUserName()), SubConstructionUser::getUserName, dto.getUserName())
.isNotNull(SubConstructionUser::getTeamId);
if("1".equals(dto.getType())){
if ("1".equals(dto.getType())) {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}else if("2".equals(dto.getType())){
if(dto.getIsToday()){
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()),SubConstructionUser::getSysUserId, dto.getUserIds());
}else {
} else if ("2".equals(dto.getType())) {
if (dto.getIsToday()) {
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()), SubConstructionUser::getSysUserId, dto.getUserIds());
} else {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}
}else{
} else {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}
@ -1654,16 +1655,16 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
.eq(StrUtil.isNotBlank(dto.getTypeOfWork()), SubConstructionUser::getTypeOfWork, dto.getTypeOfWork())
.like(StrUtil.isNotBlank(dto.getUserName()), SubConstructionUser::getUserName, dto.getUserName())
.isNotNull(SubConstructionUser::getTeamId);
if("1".equals(dto.getType())){
if ("1".equals(dto.getType())) {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}else if("2".equals(dto.getType())){
if(dto.getIsToday()){
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()),SubConstructionUser::getSysUserId, dto.getUserIds());
}else {
} else if ("2".equals(dto.getType())) {
if (dto.getIsToday()) {
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()), SubConstructionUser::getSysUserId, dto.getUserIds());
} else {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}
}else{
} else {
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
}