init
parent
b92e9212aa
commit
fbaeb3e073
|
|
@ -28,7 +28,7 @@ public class EvalInternalReviewController {
|
||||||
|
|
||||||
@ApiOperation("按项目查询")
|
@ApiOperation("按项目查询")
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
public SingleResponse<EvalInternalReviewCO> get(@ApiParam("项目ID") @RequestParam String projectId) {
|
public SingleResponse<EvalInternalReviewCO> get(@ApiParam("项目ID") @RequestParam Long projectId) {
|
||||||
return evalInternalReviewApi.getByProject(projectId);
|
return evalInternalReviewApi.getByProject(projectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import org.qinan.safetyeval.client.api.institution.EvalInternalReviewApi;
|
||||||
import org.qinan.safetyeval.client.co.institution.EvalInternalReviewCO;
|
import org.qinan.safetyeval.client.co.institution.EvalInternalReviewCO;
|
||||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||||
import org.qinan.safetyeval.client.dto.institution.EvalInternalReviewSaveCmd;
|
import org.qinan.safetyeval.client.dto.institution.EvalInternalReviewSaveCmd;
|
||||||
import org.qinan.safetyeval.domain.entity.EvalProjectEntity;
|
|
||||||
import org.qinan.safetyeval.domain.entity.EvalInternalReviewEntity;
|
import org.qinan.safetyeval.domain.entity.EvalInternalReviewEntity;
|
||||||
|
import org.qinan.safetyeval.domain.entity.EvalProjectEntity;
|
||||||
import org.qinan.safetyeval.domain.exception.BizException;
|
import org.qinan.safetyeval.domain.exception.BizException;
|
||||||
import org.qinan.safetyeval.domain.exception.ErrorCode;
|
import org.qinan.safetyeval.domain.exception.ErrorCode;
|
||||||
import org.qinan.safetyeval.domain.gateway.EvalInternalReviewGateway;
|
import org.qinan.safetyeval.domain.gateway.EvalInternalReviewGateway;
|
||||||
|
|
@ -47,11 +47,10 @@ public class EvalInternalReviewExecutor implements EvalInternalReviewApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<EvalInternalReviewCO> getByProject(String projectId) {
|
public SingleResponse<EvalInternalReviewCO> getByProject(Long projectId) {
|
||||||
Long pid = Long.parseLong(projectId);
|
evalProjectNodeSupport.assertRead(projectId);
|
||||||
evalProjectNodeSupport.assertRead(pid);
|
EvalProjectEntity project = evalProjectNodeSupport.requireProject(projectId);
|
||||||
EvalProjectEntity project = evalProjectNodeSupport.requireProject(pid);
|
EvalInternalReviewEntity entity = evalInternalReviewGateway.getByProjectId(projectId, project.getOrgId());
|
||||||
EvalInternalReviewEntity entity = evalInternalReviewGateway.getByProjectId(pid, project.getOrgId());
|
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new BizException(ErrorCode.EVAL_INTERNAL_REVIEW_NOT_FOUND);
|
throw new BizException(ErrorCode.EVAL_INTERNAL_REVIEW_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ import org.qinan.safetyeval.client.dto.institution.EvalInternalReviewSaveCmd;
|
||||||
|
|
||||||
public interface EvalInternalReviewApi {
|
public interface EvalInternalReviewApi {
|
||||||
SingleResponse<EvalInternalReviewCO> getOrSave(EvalInternalReviewSaveCmd cmd);
|
SingleResponse<EvalInternalReviewCO> getOrSave(EvalInternalReviewSaveCmd cmd);
|
||||||
SingleResponse<EvalInternalReviewCO> getByProject(String projectId);
|
SingleResponse<EvalInternalReviewCO> getByProject(Long projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue