风险预警
parent
cef933f76f
commit
dfe62a354a
|
|
@ -6,6 +6,7 @@ import org.qinan.safetyeval.client.api.institution.EvalSurveyAttachApi;
|
||||||
import org.qinan.safetyeval.client.co.institution.EvalSurveyAttachCO;
|
import org.qinan.safetyeval.client.co.institution.EvalSurveyAttachCO;
|
||||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||||
import org.qinan.safetyeval.client.dto.institution.EvalSurveyAttachSaveCmd;
|
import org.qinan.safetyeval.client.dto.institution.EvalSurveyAttachSaveCmd;
|
||||||
|
import org.qinan.safetyeval.domain.constant.ProjectDocumentEnum;
|
||||||
import org.qinan.safetyeval.domain.constant.ProjectStageEnum;
|
import org.qinan.safetyeval.domain.constant.ProjectStageEnum;
|
||||||
import org.qinan.safetyeval.domain.entity.EvalSurveyAttachEntity;
|
import org.qinan.safetyeval.domain.entity.EvalSurveyAttachEntity;
|
||||||
import org.qinan.safetyeval.domain.service.EvalSurveyDomainService;
|
import org.qinan.safetyeval.domain.service.EvalSurveyDomainService;
|
||||||
|
|
@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -53,6 +55,24 @@ public class EvalSurveyAttachExecutor implements EvalSurveyAttachApi {
|
||||||
.eq(EvalSurveyDO::getProjectId, cmdList.get(0).getProjectId()));
|
.eq(EvalSurveyDO::getProjectId, cmdList.get(0).getProjectId()));
|
||||||
if (cmdList.get(0).getProjectId() != null && (Objects.isNull(num) ? 0 : num) >= 2) {
|
if (cmdList.get(0).getProjectId() != null && (Objects.isNull(num) ? 0 : num) >= 2) {
|
||||||
projectStageSyncService.onNodeCompleted(Long.valueOf(cmdList.get(0).getProjectId()), ProjectStageEnum.SITE_SURVEY.getNode());
|
projectStageSyncService.onNodeCompleted(Long.valueOf(cmdList.get(0).getProjectId()), ProjectStageEnum.SITE_SURVEY.getNode());
|
||||||
|
// 判断是否有企业整改附件, 和整改复查附件
|
||||||
|
List<EvalSurveyAttachCO> data = listByProject(Long.valueOf(cmdList.get(0).getProjectId())).getData();
|
||||||
|
long enterpriseCount = data.stream().filter(f -> ProjectDocumentEnum.ENTERPRISE_RECTIFICATION.getVal().equals(f.getAttachTypeCode())
|
||||||
|
&& StringUtils.hasText(f.getFileUrl())).count();
|
||||||
|
if (enterpriseCount == 0) {
|
||||||
|
// todo新增预警数据: 企业整改附件未传
|
||||||
|
|
||||||
|
}
|
||||||
|
long rectificationCountPrefix = data.stream().filter(f -> ProjectDocumentEnum.RECTIFICATION_NOTICE.getVal().equals(f.getAttachTypeCode())
|
||||||
|
&& f.getCheckbox() == 1).count();
|
||||||
|
if (rectificationCountPrefix >= 1) {
|
||||||
|
long rectificationCount = data.stream().filter(f -> ProjectDocumentEnum.RECTIFICATION_REVIEW.getVal().equals(f.getAttachTypeCode())
|
||||||
|
&& StringUtils.hasText(f.getFileUrl())).count();
|
||||||
|
if (rectificationCount == 0) {
|
||||||
|
// todo 新增预警数据: 整改复查附件未传
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return SingleResponse.success(true);
|
return SingleResponse.success(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,7 @@ public class EvalSurveyAttachCO {
|
||||||
|
|
||||||
@ApiModelProperty("文件地址")
|
@ApiModelProperty("文件地址")
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("勾选框: 0-不勾选,1-勾选")
|
||||||
|
private Integer checkbox;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,7 @@ public class EvalSurveyAttachSaveCmd {
|
||||||
|
|
||||||
@ApiModelProperty("文件地址")
|
@ApiModelProperty("文件地址")
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("勾选框: 0-不勾选,1-勾选")
|
||||||
|
private Integer checkbox;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,5 @@ public class EvalSurveyAttachEntity {
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
private String attachTypeCode;
|
private String attachTypeCode;
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
private Integer checkbox;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,5 @@ public class EvalSurveyAttachDO {
|
||||||
/** 附件类型编码(ProjectDocumentEnum.val) */
|
/** 附件类型编码(ProjectDocumentEnum.val) */
|
||||||
private String attachTypeCode;
|
private String attachTypeCode;
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
private Integer checkbox;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue