[feat]合并wyw-7.26外包合同管理模块2

This commit is contained in:
Qiancheng Zhao
2024-07-31 10:05:42 +08:00
44 changed files with 999 additions and 606 deletions

View File

@ -14,4 +14,10 @@ public interface ProjectApi {
*/
ProjectDetailRespDTO getProjectDetailById(Long projectId);
/**
* 判断项目是否存在
* @param projectId
*/
void validProjectExist(Long projectId);
}

View File

@ -10,10 +10,14 @@ import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
@Service
@Validated
public class ProjectImpl implements ProjectApi {
@Resource
private ProjectMapper projectMapper;
@ -31,4 +35,12 @@ public class ProjectImpl implements ProjectApi {
ProjectDetailRespDTO detailRespDTO = BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
return detailRespDTO;
}
@Override
public void validProjectExist(Long projectId) {
if (projectMapper.selectById(projectId) == null) {
throw exception(PROJECT_NOT_EXISTS);
}
}
}