PaperBasicInfo
parent
d2bebf83a3
commit
ff1e0ae8fd
|
|
@ -12,6 +12,7 @@ import org.qinan.safetyeval.client.dto.SingleResponse;
|
|||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportBatchSubmitCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPreparationCompleteCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportSubmitCmd;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -62,4 +63,11 @@ public class InstitutionEvalReportController {
|
|||
@Validated @RequestBody InstitutionEvalReportBatchSubmitCmd cmd) {
|
||||
return institutionEvalReportApi.batchSubmit(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("完成报告编制(REPORT_PREPARATION 节点置为已完成,项目须未归档)")
|
||||
@PostMapping("/preparation/complete")
|
||||
public SingleResponse<Void> completePreparation(
|
||||
@Validated @RequestBody InstitutionEvalReportPreparationCompleteCmd cmd) {
|
||||
return institutionEvalReportApi.completePreparation(cmd);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ public class WpsExecutor implements WpsApi {
|
|||
WpsDocEntity updated = wpsDocDomainService.completeSave(doc, versionEntity);
|
||||
log.info("wps upload complete, body={}", JSON.toJSONString(body));
|
||||
// 修改节点状态
|
||||
projectStageSyncService.onNodeCompleted(doc.getProjectId(), ProjectStageEnum.REPORT_PREPARATION.getNode());
|
||||
// projectStageSyncService.onNodeCompleted(doc.getProjectId(), ProjectStageEnum.REPORT_PREPARATION.getNode());
|
||||
return ok(wpsCmdConvertor.toFileCO(updated));
|
||||
} catch (BizException e) {
|
||||
return fail(e);
|
||||
|
|
|
|||
|
|
@ -11,12 +11,17 @@ import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPageQuer
|
|||
import org.qinan.safetyeval.client.co.report.InstitutionEvalReportBatchSubmitResultCO;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportSubmitCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportBatchSubmitCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPreparationCompleteCmd;
|
||||
import org.qinan.safetyeval.domain.entity.EvalProjectEntity;
|
||||
import org.qinan.safetyeval.domain.entity.EvalReportEntity;
|
||||
import org.qinan.safetyeval.domain.exception.BizException;
|
||||
import org.qinan.safetyeval.domain.exception.ErrorCode;
|
||||
import org.qinan.safetyeval.domain.query.EvalReportQuery;
|
||||
import org.qinan.safetyeval.domain.query.PageResult;
|
||||
import org.qinan.safetyeval.domain.service.EvalProjectDomainService;
|
||||
import org.qinan.safetyeval.domain.service.EvalReportDomainService;
|
||||
import org.qinan.safetyeval.domain.service.ProjectStageSyncService;
|
||||
import org.qinan.safetyeval.domain.support.EvalNodeCodes;
|
||||
import org.qinan.safetyeval.infrastructure.support.InstitutionOrgSupport;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -39,6 +44,14 @@ public class InstitutionEvalReportExecutor implements InstitutionEvalReportApi {
|
|||
@Autowired(required = false)
|
||||
private InstitutionOrgSupport institutionOrgSupport;
|
||||
|
||||
@Lazy
|
||||
@Autowired(required = false)
|
||||
private EvalProjectDomainService evalProjectDomainService;
|
||||
|
||||
@Lazy
|
||||
@Autowired(required = false)
|
||||
private ProjectStageSyncService projectStageSyncService;
|
||||
|
||||
@Override
|
||||
public PageResponse<EvalReportLibraryCO> page(InstitutionEvalReportPageQuery query) {
|
||||
EvalReportQuery domainQuery = new EvalReportQuery();
|
||||
|
|
@ -146,6 +159,21 @@ public class InstitutionEvalReportExecutor implements InstitutionEvalReportApi {
|
|||
return SingleResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成报告编制:将项目节点 REPORT_PREPARATION(NODE_05)的 state 置为 1。
|
||||
* 前提条件:项目未归档(assertModifiable 校验 archiveFlag=1 时抛 EVAL_PROJECT_ARCHIVED)。
|
||||
*/
|
||||
@Override
|
||||
public SingleResponse<Void> completePreparation(InstitutionEvalReportPreparationCompleteCmd cmd) {
|
||||
EvalProjectEntity project = evalProjectDomainService.get(cmd.getProjectId());
|
||||
if(project == null){
|
||||
throw new BizException(ErrorCode.EVAL_PROJECT_NOT_FOUND);
|
||||
}
|
||||
evalProjectDomainService.assertModifiable(project);
|
||||
projectStageSyncService.onNodeCompleted(cmd.getProjectId(), EvalNodeCodes.NODE_05);
|
||||
return SingleResponse.success();
|
||||
}
|
||||
|
||||
private void addFail(InstitutionEvalReportBatchSubmitResultCO result, Long id, String reason) {
|
||||
InstitutionEvalReportBatchSubmitResultCO.FailItem item = new InstitutionEvalReportBatchSubmitResultCO.FailItem();
|
||||
item.setId(id);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.qinan.safetyeval.client.dto.SingleResponse;
|
|||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportBatchSubmitCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportPreparationCompleteCmd;
|
||||
import org.qinan.safetyeval.client.dto.institution.InstitutionEvalReportSubmitCmd;
|
||||
|
||||
public interface InstitutionEvalReportApi {
|
||||
|
|
@ -27,4 +28,13 @@ public interface InstitutionEvalReportApi {
|
|||
* 复用单条 submit 的报送规则,逐条报送并收集失败明细,不因单条失败中断整体。
|
||||
*/
|
||||
SingleResponse<InstitutionEvalReportBatchSubmitResultCO> batchSubmit(InstitutionEvalReportBatchSubmitCmd cmd);
|
||||
|
||||
/**
|
||||
* 完成报告编制:将项目节点 REPORT_PREPARATION 的 state 置为 1(已完成)。
|
||||
* 前提条件:项目未归档,已归档项目不可修改。
|
||||
*
|
||||
* @param cmd 含项目ID
|
||||
* @return 无数据返回
|
||||
*/
|
||||
SingleResponse<Void> completePreparation(InstitutionEvalReportPreparationCompleteCmd cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package org.qinan.safetyeval.client.dto.institution;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 机构端完成报告编制(将项目节点 REPORT_PREPARATION 置为已完成)
|
||||
*/
|
||||
@Data
|
||||
public class InstitutionEvalReportPreparationCompleteCmd {
|
||||
|
||||
@NotNull(message = "项目ID不能为空")
|
||||
@ApiModelProperty(value = "项目ID", required = true)
|
||||
private Long projectId;
|
||||
}
|
||||
Loading…
Reference in New Issue