进度,人员bug

This commit is contained in:
lcj
2025-09-16 22:01:07 +08:00
parent 8b4e56e6e8
commit 223f1aee98
11 changed files with 100 additions and 20 deletions

View File

@ -196,5 +196,8 @@ public class SubConstructionUser extends BaseEntity {
*/
private String remark;
/**
* 首次入职时间
*/
private LocalDate firstDate;
}

View File

@ -223,7 +223,13 @@ public interface ISubConstructionUserService extends IService<SubConstructionUse
*/
SubConstructionUser getBySysUserId(Long sysUserId);
/**
* 查询施工人员未分配列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 施工人员未分配列表
*/
TableDataInfo<SubConstructionUserAppVo> queryUndistributedList(SubConstructionUserQueryReq req, PageQuery pageQuery);
void deleteeBySysUserIds( List<Long> ids);

View File

@ -750,13 +750,14 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
lqw.eq(ObjectUtils.isNotEmpty(contractorId), SubConstructionUser::getContractorId, contractorId);
lqw.eq(ObjectUtils.isNotEmpty(teamId), SubConstructionUser::getTeamId, teamId);
lqw.eq(StringUtils.isNotBlank(sex), SubConstructionUser::getSex, sex);
lqw.eq(ObjectUtils.isNotEmpty(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
lqw.eq(StringUtils.isNotBlank(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
lqw.eq(ObjectUtils.isNotEmpty(clock), SubConstructionUser::getClock, clock);
lqw.eq(StringUtils.isNotBlank(userRole), SubConstructionUser::getUserRole, userRole);
if (StringUtils.isNotBlank(workStatus)) {
if (workStatus.equals("0")) {
lqw.isNotNull(SubConstructionUser::getTeamId).ne(SubConstructionUser::getTeamId, "");
} else if (workStatus.equals("1")) {
if ("0".equals(workStatus)) {
lqw.isNotNull(SubConstructionUser::getTeamId)
.ne(SubConstructionUser::getTeamId, "");
} else if ("1".equals(workStatus)) {
lqw.isNull(SubConstructionUser::getTeamId);
}
}
@ -767,12 +768,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
.or().isNull(SubConstructionUser::getTeamId));
}
// 查询当前项目下的黑名单人员
List<Long> blackUserIdList;
if (projectId != null) {
blackUserIdList = constructionBlacklistService.queryIdListByProjectId(projectId);
} else {
blackUserIdList = constructionBlacklistService.queryIdListByProjectId(null);
}
List<Long> blackUserIdList = constructionBlacklistService.queryIdListByProjectId(projectId);
if (CollUtil.isNotEmpty(blackUserIdList)) {
lqw.notIn(SubConstructionUser::getSysUserId, blackUserIdList);
}
@ -1290,7 +1286,13 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
return reqBase64;
}
/**
* 查询施工人员未分配列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 施工人员未分配列表
*/
@Override
public TableDataInfo<SubConstructionUserAppVo> queryUndistributedList(SubConstructionUserQueryReq req, PageQuery pageQuery) {
LambdaQueryWrapper<SubConstructionUser> lqw = Wrappers.lambdaQuery();

View File

@ -6,6 +6,7 @@ import org.dromara.manager.ys7manager.Ys7Manager;
import org.dromara.manager.ys7manager.vo.Ys7QueryDeviceResponseVo;
import org.dromara.other.service.IOthYs7DeviceService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;

View File

@ -120,6 +120,20 @@ public class PgsConstructionSchedulePlanController extends BaseController {
return toAjax(pgsConstructionSchedulePlanService.updateByBo(req));
}
/**
* 修改施工进度计划为完成状态
*
* @param id 主键
*/
@SaCheckPermission("progress:constructionSchedulePlan:editFinish")
@Log(title = "施工进度计划", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping("/finish/{id}")
public R<Void> editFinish(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return toAjax(pgsConstructionSchedulePlanService.updateFinish(id));
}
/**
* 删除施工进度计划
*

View File

@ -67,8 +67,8 @@ public class PgsProgressPlanDetailController extends BaseController {
* 新增进度计划详情AI 填报)
*/
@PostMapping("/insert/numberAI")
public R<Void> insertNumberDetailByAI(@RequestPart("file") MultipartFile file) {
return toAjax(pgsProgressPlanDetailService.insertNumberDetailByAI(file));
public R<Void> insertNumberDetailByAI(@RequestPart("file") MultipartFile file, Long projectId, String url) {
return toAjax(pgsProgressPlanDetailService.insertNumberDetailByAI(file, projectId, url));
}
/**

View File

@ -54,6 +54,14 @@ public interface IPgsConstructionSchedulePlanService extends IService<PgsConstru
*/
Boolean updateByBo(PgsConstructionSchedulePlanUpdateReq req);
/**
* 修改施工进度计划为完成状态
*
* @param id 主键
* @return 是否修改成功
*/
Boolean updateFinish(Long id);
/**
* 批量删除施工进度计划信息
*

View File

@ -135,8 +135,9 @@ public interface IPgsProgressPlanDetailService extends IService<PgsProgressPlanD
/**
* 使用AI识别计划详情设施数量
*
* @param file 文件
* @param file 文件
* @param projectId 项目id
* @return 是否成功
*/
Boolean insertNumberDetailByAI(MultipartFile file);
Boolean insertNumberDetailByAI(MultipartFile file, Long projectId,String url);
}

View File

@ -114,6 +114,25 @@ public class PgsConstructionSchedulePlanServiceImpl extends ServiceImpl<PgsConst
return this.updateById(constructionSchedulePlan);
}
/**
* 修改施工进度计划为完成状态
*
* @param id 主键
* @return 是否修改成功
*/
@Override
public Boolean updateFinish(Long id) {
PgsConstructionSchedulePlan plan = this.getById(id);
if (plan == null) {
throw new ServiceException("施工进度计划信息不存在", HttpStatus.NOT_FOUND);
}
if (plan.getStatus().equals("4")) {
throw new ServiceException("施工进度计划已完成", HttpStatus.NOT_FOUND);
}
plan.setStatus("4");
return this.updateById(plan);
}
/**
* 批量删除施工进度计划信息
*

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.constant.HttpStatus;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.ObjectUtils;
@ -20,6 +21,11 @@ import org.dromara.facility.domain.*;
import org.dromara.facility.domain.enums.FacFinishStatusEnum;
import org.dromara.facility.domain.enums.FacFinishTypeEnum;
import org.dromara.facility.service.*;
import org.dromara.manager.recognizermanager.RecognizerManager;
import org.dromara.manager.recognizermanager.enums.RecognizerHasTargetEnum;
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
import org.dromara.manager.recognizermanager.vo.RecognizeTargetVo;
import org.dromara.manager.recognizermanager.vo.RecognizeVo;
import org.dromara.out.domain.OutConstructionValue;
import org.dromara.out.service.IOutConstructionValueService;
import org.dromara.progress.constant.PgsProgressCategoryConstant;
@ -62,6 +68,7 @@ import java.util.stream.Collectors;
* @author lilemy
* @date 2025-05-27
*/
@Slf4j
@Service
public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPlanDetailMapper, PgsProgressPlanDetail>
implements IPgsProgressPlanDetailService {
@ -97,6 +104,9 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
@Resource
private IOutConstructionValueService constructionValueService;
@Resource
private RecognizerManager recognizerManager;
/**
* 分页查询进度计划详情列表
*
@ -889,12 +899,28 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
/**
* 使用AI识别计划详情设施数量
*
* @param file 文件
* @param file 文件
* @param projectId 项目id
* @return 是否成功
*/
@Override
public Boolean insertNumberDetailByAI(MultipartFile file) {
return null;
public Boolean insertNumberDetailByAI(MultipartFile file, Long projectId,String url) {
// 识别类型:洞、桩、架、架子
List<RecognizerTypeEnum> enumList = List.of(RecognizerTypeEnum.PHO);
/* List<RecognizerTypeEnum> enumList = List.of(RecognizerTypeEnum.HOLE, RecognizerTypeEnum.PHO,
RecognizerTypeEnum.PILE, RecognizerTypeEnum.SHELVES);*/
// 调用识别算法
RecognizeVo recognize = recognizerManager.recognize(url, enumList);
if (recognize == null) {
return false;
}
if (recognize.getHasTarget().equals(RecognizerHasTargetEnum.NO.getValue())) {
log.info("没有识别到设施");
return true;
}
// 处理设施
List<RecognizeTargetVo> targets = recognize.getTargets();
return true;
}
/**

View File

@ -200,7 +200,7 @@ public class PgsProgressPlanServiceImpl extends ServiceImpl<PgsProgressPlanMappe
if (progressPlan == null) {
throw new ServiceException("进度计划信息不存在", HttpStatus.NOT_FOUND);
}
if (progressPlan.getPlanNumber() != null && progressPlan.getPlanNumber().compareTo(BigDecimal.ZERO) != 0) {
if (progressPlan.getFinishedNumber() != null && progressPlan.getFinishedNumber().compareTo(BigDecimal.ZERO) > 0) {
throw new ServiceException("已存在完成的设施,无法删除", HttpStatus.CONFLICT);
}
// 删除数据